witgen is a library to help you generate wit definitions in a wit file for WebAssembly. Using this lib in addition to wit-bindgen will help you to import/export types and functions from/to wasm module.
Cargo.toml
toml
witgen = "0.2"
cargo witgen
CLIbash
$ cargo install cargo-witgen
```rust use witgen::witgen;
struct TestStruct { inner: String, }
enum TestEnum { Unit, Number(u64), String(String), }
fn test(other: Vec
bash
$ cargo witgen generate
witgen.wit
file at the root of your package:```wit record TestStruct { inner: string }
variant TestEnum { Unit, Number(u64), String(string), }
test : function(other: list
#[witgen]
to put on enum, struct and functions