Struct wasmer_runtime_core_x::DynFunc
source · pub struct DynFunc<'a> { /* private fields */ }
Expand description
A representation of an exported WebAssembly function.
Implementations§
source§impl<'a> DynFunc<'a>
impl<'a> DynFunc<'a>
sourcepub fn call(&self, params: &[Value]) -> CallResult<Vec<Value>>
pub fn call(&self, params: &[Value]) -> CallResult<Vec<Value>>
Call an exported WebAssembly function safely.
Pass arguments by wrapping each one in the Value
enum.
The returned values are also each wrapped in a Value
.
§Note:
This returns CallResult<Vec<Value>>
in order to support
the future multi-value returns WebAssembly feature.
§Usage:
instance
.dyn_func("foo")?
.call(&[])?;
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for DynFunc<'a>
impl<'a> !RefUnwindSafe for DynFunc<'a>
impl<'a> !Send for DynFunc<'a>
impl<'a> !Sync for DynFunc<'a>
impl<'a> Unpin for DynFunc<'a>
impl<'a> !UnwindSafe for DynFunc<'a>
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
source§impl<'a, F> StorableInTable for F
impl<'a, F> StorableInTable for F
source§fn unwrap_self(
storage: &TableStorage,
index: u32
) -> Result<F, TableAccessError>
fn unwrap_self( storage: &TableStorage, index: u32 ) -> Result<F, TableAccessError>
Attempt to lookup self in the given table.
source§fn wrap_self(
self,
storage: &mut TableStorage,
index: u32
) -> Result<(), TableAccessError>
fn wrap_self( self, storage: &mut TableStorage, index: u32 ) -> Result<(), TableAccessError>
Wrap value to be stored in a table.