pub trait WasiImplementation<WB: WasmBackend> {
// Required methods
fn register_in_linker(
store: &mut <WB as WasmBackend>::ContextMut<'_>,
linker: &mut <WB as WasmBackend>::Imports,
config: WasiParameters
) -> Result<(), WasiError>;
fn get_wasi_state<'s>(
instance: &'s mut <WB as WasmBackend>::Instance
) -> Box<dyn WasiState + 's>;
}
Expand description
A type that provides WASI functionality to the given Wasm backend.
Required Methods§
sourcefn register_in_linker(
store: &mut <WB as WasmBackend>::ContextMut<'_>,
linker: &mut <WB as WasmBackend>::Imports,
config: WasiParameters
) -> Result<(), WasiError>
fn register_in_linker( store: &mut <WB as WasmBackend>::ContextMut<'_>, linker: &mut <WB as WasmBackend>::Imports, config: WasiParameters ) -> Result<(), WasiError>
Configures WASI state and adds WASI functions to the imports
object.
§Errors:
Returns an error if failed to open a open a directory/file.
sourcefn get_wasi_state<'s>(
instance: &'s mut <WB as WasmBackend>::Instance
) -> Box<dyn WasiState + 's>
fn get_wasi_state<'s>( instance: &'s mut <WB as WasmBackend>::Instance ) -> Box<dyn WasiState + 's>
Optional API for getting current WASI state. Returns None if not supported by current backend.
Object Safety§
This trait is not object safe.