# wasmgc
WasmGC support for Rust: GC structs, arrays, and external references.
```rust
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:
```sh
cargo install wasmgc --features cli
```
Build your application as a `cdylib` for `wasm32-unknown-unknown`, then postprocess it:
```sh
wasmgc input.wasm -o output.wasm
```
Requires a WasmGC-capable engine.