pub trait WasmModule:
Send
+ Sync
+ 'static {
// Required methods
fn metadata(&self) -> ModuleMetadata;
fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn instantiate<'life0, 'async_trait>(
&'life0 mut self,
_bus: MessageBus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Trait implemented by WebAssembly plugins.
Right now the trait is a thin placeholder: it mirrors Module but uses a
distinct identity so the manager can keep native and WASM modules separate
and apply different sandboxing/security policies later (e.g. wasmtime
engine configuration, capability gating).
Required Methods§
Sourcefn metadata(&self) -> ModuleMetadata
fn metadata(&self) -> ModuleMetadata
Static module metadata. The kind field should be
ModuleKind::Wasm.
Provided Methods§
Sourcefn instantiate<'life0, 'async_trait>(
&'life0 mut self,
_bus: MessageBus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn instantiate<'life0, 'async_trait>(
&'life0 mut self,
_bus: MessageBus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Instantiate the WASM module inside the host runtime.