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.