pub struct RuntimeInstance<'b, H = EmptyHookSet>
where H: HookSet,
{ pub wasm_bytecode: &'b [u8], types: Vec<FuncType>, exports: Vec<Export>, 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>

source

pub fn new(validation_info: &ValidationInfo<'b>) -> Result<Self, RuntimeError>

source§

impl<'b, H> RuntimeInstance<'b, H>
where H: HookSet,

source

pub fn new_with_hooks( validation_info: &ValidationInfo<'b>, hook_set: H ) -> Result<Self, RuntimeError>

source

pub fn invoke_named<Param: InteropValueList, Returns: InteropValueList>( &mut self, func_name: &str, param: Param ) -> Result<Returns, RuntimeError>

source

pub fn invoke_func<Param: InteropValueList, Returns: InteropValueList>( &mut self, func_idx: usize, params: Param ) -> Result<Returns, RuntimeError>

Can only invoke functions with signature [t1] -> [t2] as of now.

source

pub fn invoke_dynamic( &mut self, func_idx: usize, 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.

source

fn init_store(validation_info: &ValidationInfo<'_>) -> Store

Auto Trait Implementations§

§

impl<'b, H> Freeze for RuntimeInstance<'b, H>
where H: Freeze,

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.