Struct parity_wasm::ModuleInstance
[−]
[src]
pub struct ModuleInstance<E: UserError> { /* fields omitted */ }
Module instance.
Methods
impl<E> ModuleInstance<E> where
E: UserError,
[src]
E: UserError,
fn new<'a>(
program: Weak<ProgramInstanceEssence<E>>,
name: String,
module: Module
) -> Result<Self, Error<E>>
[src]
program: Weak<ProgramInstanceEssence<E>>,
name: String,
module: Module
) -> Result<Self, Error<E>>
Instantiate given module within program context.
fn instantiate<'a>(
&mut self,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface<E> + 'a>>>
) -> Result<(), Error<E>>
[src]
&mut self,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface<E> + 'a>>>
) -> Result<(), Error<E>>
Run instantiation-time procedures (validation). Module is not completely validated until this call.
fn run_start_function(&self) -> Result<(), Error<E>>
[src]
Run start function [if any].
Trait Implementations
impl<E> ModuleInstanceInterface<E> for ModuleInstance<E> where
E: UserError,
[src]
E: UserError,
fn execute_index(
&self,
index: u32,
params: ExecutionParams<E>
) -> Result<Option<RuntimeValue>, Error<E>>
[src]
&self,
index: u32,
params: ExecutionParams<E>
) -> Result<Option<RuntimeValue>, Error<E>>
Execute function with the given index.
fn execute_export(
&self,
name: &str,
params: ExecutionParams<E>
) -> Result<Option<RuntimeValue>, Error<E>>
[src]
&self,
name: &str,
params: ExecutionParams<E>
) -> Result<Option<RuntimeValue>, Error<E>>
Execute function with the given export name.
fn export_entry<'a>(
&self,
name: &str,
required_type: &ExportEntryType
) -> Result<Internal, Error<E>>
[src]
&self,
name: &str,
required_type: &ExportEntryType
) -> Result<Internal, Error<E>>
Get export entry.
fn table(&self, index: ItemIndex) -> Result<Arc<TableInstance<E>>, Error<E>>
[src]
Get table reference.
fn memory(&self, index: ItemIndex) -> Result<Arc<MemoryInstance<E>>, Error<E>>
[src]
Get memory reference.
fn global<'a>(
&self,
index: ItemIndex,
variable_type: Option<VariableType>,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface<E> + 'a>>>
) -> Result<Arc<VariableInstance<E>>, Error<E>>
[src]
&self,
index: ItemIndex,
variable_type: Option<VariableType>,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface<E> + 'a>>>
) -> Result<Arc<VariableInstance<E>>, Error<E>>
Get global reference.
fn function_type(
&self,
function_index: ItemIndex
) -> Result<FunctionSignature, Error<E>>
[src]
&self,
function_index: ItemIndex
) -> Result<FunctionSignature, Error<E>>
Get function type for given function index.
fn function_type_by_index(
&self,
type_index: u32
) -> Result<FunctionSignature, Error<E>>
[src]
&self,
type_index: u32
) -> Result<FunctionSignature, Error<E>>
Get function type for given function index.
fn function_reference<'a>(
&self,
index: ItemIndex,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface<E> + 'a>>>
) -> Result<InternalFunctionReference<'a, E>, Error<E>>
[src]
&self,
index: ItemIndex,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface<E> + 'a>>>
) -> Result<InternalFunctionReference<'a, E>, Error<E>>
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<E> + 'a>>>
) -> Result<InternalFunctionReference<'a, E>, Error<E>>
[src]
&self,
table_idx: u32,
type_idx: u32,
func_idx: u32,
externals: Option<&'a HashMap<String, Arc<ModuleInstanceInterface<E> + 'a>>>
) -> Result<InternalFunctionReference<'a, E>, Error<E>>
Get function indirect reference.
fn function_body<'a>(
&'a self,
internal_index: u32
) -> Result<Option<InternalFunction<'a>>, Error<E>>
[src]
&'a self,
internal_index: u32
) -> Result<Option<InternalFunction<'a>>, Error<E>>
Get internal function for interpretation.
fn call_internal_function(
&self,
outer: CallerContext<E>,
index: u32
) -> Result<Option<RuntimeValue>, Error<E>>
[src]
&self,
outer: CallerContext<E>,
index: u32
) -> Result<Option<RuntimeValue>, Error<E>>
Call function with given internal index.