Expand description
WASM plugin traits for compiling, instantiating, and calling WASM modules.
These traits abstract over a concrete WASM runtime (e.g. wasmtime) so
the plugin host can work with any backend. The pd-wasm-wasmtime crate
provides the production implementation via WasmtimeHost.
§Design notes
WasmImportsclosures have+ Send + Sync + 'staticbounds so they can be registered as wasmtime host functions, which requireSend + Sync.WasmActor(Phase 5.6) usesArc<Mutex<…>>for the outbox buffer.WasmModuleexposesas_any()so the concreteWasmHostcan downcast theBox<dyn WasmModule>it created back to its own type without a separate runtime registry.
Structs§
- Wasm
Imports - Host function callbacks injected into a WASM module at instantiation.
Enums§
- Wasm
Error - Errors that can occur during WASM module compilation, instantiation, or execution.
- WasmVal
- A WASM numeric value, used for function call arguments and return values.
Traits§
- Wasm
Host - Factory for compiling and instantiating WASM modules.
- Wasm
Instance - A fully instantiated WASM module, ready to execute exported functions.
- Wasm
Module - A compiled (but not yet instantiated) WASM module.