Trait parity_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
fn execute_index(
&self,
index: u32,
params: ExecutionParams
) -> Result<Option<RuntimeValue>, Error>
&self,
index: u32,
params: ExecutionParams
) -> Result<Option<RuntimeValue>, Error>
Execute function with the given index.
fn execute_export(
&self,
name: &str,
params: ExecutionParams
) -> Result<Option<RuntimeValue>, Error>
&self,
name: &str,
params: ExecutionParams
) -> Result<Option<RuntimeValue>, Error>
Execute function with the given export name.
fn export_entry<'a>(
&self,
name: &str,
required_type: &ExportEntryType
) -> Result<Internal, Error>
&self,
name: &str,
required_type: &ExportEntryType
) -> Result<Internal, Error>
Get export entry.
fn table(&self, index: ItemIndex) -> Result<Arc<TableInstance>, Error>
Get table reference.
fn memory(&self, index: ItemIndex) -> Result<Arc<MemoryInstance>, Error>
Get memory reference.
fn global<'a>(
&self,
index: ItemIndex,
variable_type: Option<VariableType>,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
) -> Result<Arc<VariableInstance>, Error>
&self,
index: ItemIndex,
variable_type: Option<VariableType>,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
) -> Result<Arc<VariableInstance>, Error>
Get global reference.
fn function_type(
&self,
function_index: ItemIndex
) -> Result<FunctionSignature, Error>
&self,
function_index: ItemIndex
) -> Result<FunctionSignature, Error>
Get function type for given function index.
fn function_type_by_index(
&self,
type_index: u32
) -> Result<FunctionSignature, Error>
&self,
type_index: u32
) -> Result<FunctionSignature, Error>
Get function type for given function index.
fn function_reference<'a>(
&self,
index: ItemIndex,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
) -> Result<InternalFunctionReference<'a>, Error>
&self,
index: ItemIndex,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
) -> Result<InternalFunctionReference<'a>, Error>
Get function reference.
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>
&self,
table_idx: u32,
type_idx: u32,
func_idx: u32,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
) -> Result<InternalFunctionReference<'a>, Error>
Get function indirect reference.
fn function_body<'a>(
&'a self,
internal_index: u32
) -> Result<Option<InternalFunction<'a>>, Error>
&'a self,
internal_index: u32
) -> Result<Option<InternalFunction<'a>>, Error>
Get internal function for interpretation.
fn call_internal_function(
&self,
outer: CallerContext,
index: u32
) -> Result<Option<RuntimeValue>, Error>
&self,
outer: CallerContext,
index: u32
) -> Result<Option<RuntimeValue>, Error>
Call function with given internal index.
Implementors
impl ModuleInstanceInterface for ModuleInstance