It is possible to use the wit component model with the component-model feature.
- Install Rust
- Add WASM target with
rustup target add wasm32-unknown-unknown - Install
wasm-componentwithcargo install --version 0.11.0 cargo-component
Full (minimal viable) example project setup can be found here.
Alternatively, the My first component doc contains detailed step-by-step tutorial on how to compile, load and run a wasm component.
If your world has imports, you can read WIT imports on how to define and use them.
- All primitive types (numbers, char, bool, string) supported
- Exported and imported functions with 0-N arguments and 0-N return values
- Built-in
list,option,tupleandresulttypes - Custom
record,enum,variantandflagstypes - Imported and exported interfaces
- Resources
See the wit_components test folder for supported example usages.