ReadonlyabiABI version, bumped on any ABI-breaking bridge change. The
Rust-side .bridge_abi_version linker section is read by the
loader and matched against this number; a mismatch fails-closed
before the WASM module is instantiated.
ReadonlyfeaturesCapability flags this bridge advertises. Consumers branch on the flag, not the Bridge.id.
ReadonlyidStable identifier for telemetry and benchmarking. The one shipped
id is wasmgc-classic; future bridges add new ids without
deprecating existing ones.
Resolve an opaque string handle back to a JS string.
The returned string is a plain JS string even when the bridge
keeps the underlying buffer in WASM linear memory; the bridge
never leaks JsValue (or any wasm-bindgen wrapper) into bridge
consumers.
Release a handle previously issued by this bridge. Idempotent; releasing an unknown or already-released handle is a no-op.
Register a JS object with the WASM module and return an opaque handle.
Register a JS string with the WASM module and return an opaque handle. The bridge owns the allocation; callers must Bridge.release it when done.
Result strings are allocated through the bridge's allocator so a
future wasm:string-view bridge can substitute its own without
changing the consumer surface.
Pluggable JS↔WASM boundary contract.
Remarks
Every bridge in the matrix implements this interface. The matrix is
wasmgc-classicand any future bridge (e.g.shared-memoryfor the threading EPIC);wasmgc-builtinswas in it until causl/causl-core-rs#355 retired it (see detectBridge). The BackendEngine consumes only the interface; bridges are interchangeable at runtime.Two operations dominate boundary cost — object construction and string copying — so they are the only two crossings the interface exposes as primitives. Numbers and booleans pass through cheaply (8 bytes / 4 bytes respectively) and need no bridge primitive.