Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 1.28 KB

wit_components.md

File metadata and controls

30 lines (20 loc) · 1.28 KB

Component model

It is possible to use the wit component model with the component-model feature.

Pre-requirements

  1. Install Rust
  2. Add WASM target with rustup target add wasm32-unknown-unknown
  3. Install wasm-component with cargo install --version 0.11.0 cargo-component

Project setup

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.

Implemented features

  • 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, tuple and result types
  • Custom record, enum, variant and flags types
  • Imported and exported interfaces
  • Resources

See the wit_components test folder for supported example usages.