Trait parity_wasm::ModuleInstanceInterface
[−]
[src]
pub trait ModuleInstanceInterface { fn instantiate<'a>(
&self,
is_user_module: bool,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
) -> Result<(), Error>; 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,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>,
required_type: &ExportEntryType
) -> Result<Internal, Error>; fn function_type<'a>(
&self,
function_index: ItemIndex,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
) -> Result<FunctionType, Error>; fn table(&self, index: ItemIndex) -> Result<Arc<TableInstance>, Error>; fn memory(&self, index: ItemIndex) -> Result<Arc<MemoryInstance>, Error>; fn global(
&self,
index: ItemIndex,
variable_type: Option<VariableType>
) -> Result<Arc<VariableInstance>, Error>; fn call_function(
&self,
outer: CallerContext,
index: ItemIndex,
function_type: Option<&FunctionType>
) -> Result<Option<RuntimeValue>, Error>; fn call_function_indirect(
&self,
outer: CallerContext,
table_index: ItemIndex,
type_index: u32,
func_index: u32
) -> Result<Option<RuntimeValue>, Error>; fn call_internal_function(
&self,
outer: CallerContext,
index: u32,
function_type: Option<&FunctionType>
) -> Result<Option<RuntimeValue>, Error>; }
Module instance API.
Required Methods
fn instantiate<'a>(
&self,
is_user_module: bool,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
) -> Result<(), Error>
&self,
is_user_module: bool,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
) -> Result<(), Error>
Run instantiation-time procedures (validation and start function [if any] call). Module is not completely validated until this call.
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,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>,
required_type: &ExportEntryType
) -> Result<Internal, Error>
&self,
name: &str,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>,
required_type: &ExportEntryType
) -> Result<Internal, Error>
Get export entry.
fn function_type<'a>(
&self,
function_index: ItemIndex,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
) -> Result<FunctionType, Error>
&self,
function_index: ItemIndex,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface + 'a>>>
) -> Result<FunctionType, Error>
Get function type.
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(
&self,
index: ItemIndex,
variable_type: Option<VariableType>
) -> Result<Arc<VariableInstance>, Error>
&self,
index: ItemIndex,
variable_type: Option<VariableType>
) -> Result<Arc<VariableInstance>, Error>
Get global reference.
fn call_function(
&self,
outer: CallerContext,
index: ItemIndex,
function_type: Option<&FunctionType>
) -> Result<Option<RuntimeValue>, Error>
&self,
outer: CallerContext,
index: ItemIndex,
function_type: Option<&FunctionType>
) -> Result<Option<RuntimeValue>, Error>
Call function with given index in functions index space.
fn call_function_indirect(
&self,
outer: CallerContext,
table_index: ItemIndex,
type_index: u32,
func_index: u32
) -> Result<Option<RuntimeValue>, Error>
&self,
outer: CallerContext,
table_index: ItemIndex,
type_index: u32,
func_index: u32
) -> Result<Option<RuntimeValue>, Error>
Call function with given index in the given table.
fn call_internal_function(
&self,
outer: CallerContext,
index: u32,
function_type: Option<&FunctionType>
) -> Result<Option<RuntimeValue>, Error>
&self,
outer: CallerContext,
index: u32,
function_type: Option<&FunctionType>
) -> Result<Option<RuntimeValue>, Error>
Call function with internal index.
Implementors
impl ModuleInstanceInterface for ModuleInstance