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§

source

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.
source

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.

Implementors§