Trait wasm_runtime_layer::backend::WasmInstance

source ·
pub trait WasmInstance<E: WasmEngine>: Clone + Sized + Send + Sync {
    // Required methods
    fn new(
        store: impl AsContextMut<E>,
        module: &E::Module,
        imports: &Imports<E>
    ) -> Result<Self>;
    fn exports(
        &self,
        store: impl AsContext<E>
    ) -> Box<dyn Iterator<Item = Export<E>>>;
    fn get_export(
        &self,
        store: impl AsContext<E>,
        name: &str
    ) -> Option<Extern<E>>;
}
Expand description

Provides an instantiated WASM module.

Required Methods§

source

fn new( store: impl AsContextMut<E>, module: &E::Module, imports: &Imports<E> ) -> Result<Self>

Creates a new instance.

source

fn exports( &self, store: impl AsContext<E> ) -> Box<dyn Iterator<Item = Export<E>>>

Gets the exports of this instance.

source

fn get_export(&self, store: impl AsContext<E>, name: &str) -> Option<Extern<E>>

Gets the export of the given name, if any, from this instance.

Object Safety§

This trait is not object safe.

Implementors§