Trait sophon_wasm::ModuleInstanceInterface [] [src]

pub trait ModuleInstanceInterface {
    fn execute_index(
        &self,
        index: u32,
        params: ExecutionParams
    ) -> Result<Option<RuntimeValue>, Error>;
fn execute_export(
        &self,
        name: &str,
        params: ExecutionParams
    ) -> Result<Option<RuntimeValue>, Error>;
fn export_entry<'a>(
        &self,
        name: &str,
        required_type: &ExportEntryType
    ) -> Result<Internal, Error>;
fn table(&self, index: ItemIndex) -> Result<Arc<TableInstance>, Error>;
fn memory(&self, index: ItemIndex) -> Result<Arc<MemoryInstance>, Error>;
fn global<'a>(
        &self,
        index: ItemIndex,
        variable_type: Option<VariableType>,
        externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
    ) -> Result<Arc<VariableInstance>, Error>;
fn function_type(
        &self,
        function_index: ItemIndex
    ) -> Result<FunctionSignature, Error>;
fn function_type_by_index(
        &self,
        type_index: u32
    ) -> Result<FunctionSignature, Error>;
fn function_reference<'a>(
        &self,
        index: ItemIndex,
        externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
    ) -> Result<InternalFunctionReference<'a>, Error>;
fn function_reference_indirect<'a>(
        &self,
        table_idx: u32,
        type_idx: u32,
        func_idx: u32,
        externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
    ) -> Result<InternalFunctionReference<'a>, Error>;
fn function_body<'a>(
        &'a self,
        internal_index: u32
    ) -> Result<Option<InternalFunction<'a>>, Error>;
fn call_internal_function(
        &self,
        outer: CallerContext,
        index: u32
    ) -> Result<Option<RuntimeValue>, Error>; }

Module instance API.

Required Methods

Execute function with the given index.

Execute function with the given export name.

Get export entry.

Get table reference.

Get memory reference.

Get global reference.

Get function type for given function index.

Get function type for given function index.

Get function reference.

Get function indirect reference.

Get internal function for interpretation.

Call function with given internal index.

Implementors