wasmgc 0.0.0

WasmGC types for Rust with a post-link toolchain
Documentation

wasmgc

WasmGC support for Rust: GC structs, arrays, and external references.

use wasmgc::{Gc, wasmgc};

#[wasmgc]
struct Counter {
    value: i32,
}

#[wasmgc]
pub fn example() -> i32 {
    let counter = Gc::new(Counter { value: 1 });
    counter.set_value(2);
    counter.value()
}

Install the CLI:

cargo install wasmgc --features cli

Build your application as a cdylib for wasm32-unknown-unknown, then postprocess it:

wasmgc input.wasm -o output.wasm

Requires a WasmGC-capable engine.