Skip to main content

WasmModule

Trait WasmModule 

Source
pub trait WasmModule:
    Send
    + Sync
    + 'static {
    // Required methods
    fn exports(&self) -> Vec<String>;
    fn as_any(&self) -> &dyn Any;
}
Expand description

A compiled (but not yet instantiated) WASM module.

Created by WasmHost::compile. Implementors must also expose as_any() so the host can downcast &dyn WasmModule back to its concrete type during WasmHost::instantiate.

Send + Sync are required so compiled modules can be wrapped in Arc and shared across actor factory closures (which must be Send + Sync + 'static).

Required Methods§

Source

fn exports(&self) -> Vec<String>

Names of all exports declared by the module.

Source

fn as_any(&self) -> &dyn Any

Downcast support — implementations should return self.

Implementors§