Struct wasm::execution::RuntimeInstance
source · pub struct RuntimeInstance<'b, H = EmptyHookSet>where
H: HookSet,{
pub wasm_bytecode: &'b [u8],
types: Vec<FuncType>,
exports: Vec<Export>,
pub store: Store,
pub hook_set: H,
}
Fields§
§wasm_bytecode: &'b [u8]
§types: Vec<FuncType>
§exports: Vec<Export>
§store: Store
§hook_set: H
Implementations§
source§impl<'b> RuntimeInstance<'b, EmptyHookSet>
impl<'b> RuntimeInstance<'b, EmptyHookSet>
pub fn new(validation_info: &ValidationInfo<'b>) -> Result<Self, RuntimeError>
pub fn new_named( module_name: &str, validation_info: &ValidationInfo<'b> ) -> Result<Self, RuntimeError>
source§impl<'b, H> RuntimeInstance<'b, H>where
H: HookSet,
impl<'b, H> RuntimeInstance<'b, H>where
H: HookSet,
pub fn new_with_hooks( module_name: &str, validation_info: &ValidationInfo<'b>, hook_set: H ) -> Result<Self, RuntimeError>
pub fn get_function_by_name( &self, module_name: &str, function_name: &str ) -> Result<FunctionRef, RuntimeError>
pub fn get_function_by_index( &self, module_idx: usize, function_idx: usize ) -> Result<FunctionRef, RuntimeError>
pub fn add_module( &mut self, _module_name: &str, _validation_info: &ValidationInfo<'b> ) -> Result<(), ()>
pub fn invoke<Param: InteropValueList, Returns: InteropValueList>( &mut self, function_ref: &FunctionRef, params: Param ) -> Result<Returns, RuntimeError>
sourcepub fn invoke_dynamic(
&mut self,
function_ref: &FunctionRef,
params: Vec<Value>,
ret_types: &[ValType]
) -> Result<Vec<Value>, RuntimeError>
pub fn invoke_dynamic( &mut self, function_ref: &FunctionRef, params: Vec<Value>, ret_types: &[ValType] ) -> Result<Vec<Value>, RuntimeError>
Invokes a function with the given parameters, and return types which are not known at compile time.
fn get_indicies( &self, _module_name: &str, function_name: &str ) -> Result<(usize, usize), RuntimeError>
fn verify_function_ref( &self, function_ref: &FunctionRef ) -> Result<(usize, usize), RuntimeError>
fn init_store(validation_info: &ValidationInfo<'_>) -> Store
Auto Trait Implementations§
impl<'b, H> RefUnwindSafe for RuntimeInstance<'b, H>where
H: RefUnwindSafe,
impl<'b, H> Send for RuntimeInstance<'b, H>where
H: Send,
impl<'b, H> Sync for RuntimeInstance<'b, H>where
H: Sync,
impl<'b, H> Unpin for RuntimeInstance<'b, H>where
H: Unpin,
impl<'b, H> UnwindSafe for RuntimeInstance<'b, H>where
H: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more