pub struct Runtime<'module, 'source, I: Importer> { /* private fields */ }
Implementations§
Source§impl<'m, 's, I: Importer> Runtime<'m, 's, I>
impl<'m, 's, I: Importer> Runtime<'m, 's, I>
Sourcepub fn instantiate(module: &'m Module<'s>, importer: I) -> Result<Self>
pub fn instantiate(module: &'m Module<'s>, importer: I) -> Result<Self>
Initialize states of execution (stack, memory, …) and instantiate a given module. It means that ‘start function’ is invoked in this function if presents. The module is assumed to be validated. If an invalid module is given, the behavior is unspecified, meaning that it may crash or the result may be incorrect.
https://webassembly.github.io/spec/core/exec/modules.html#instantiation
pub fn module(&self) -> &'m Module<'s>
pub fn memory(&self) -> &Memory
pub fn get_global(&self, name: &str) -> Option<Value>
pub fn invoke( &mut self, name: impl AsRef<str>, args: &[Value], ) -> Result<Option<Value>>
Auto Trait Implementations§
impl<'module, 'source, I> Freeze for Runtime<'module, 'source, I>where
I: Freeze,
impl<'module, 'source, I> RefUnwindSafe for Runtime<'module, 'source, I>where
I: RefUnwindSafe,
impl<'module, 'source, I> Send for Runtime<'module, 'source, I>where
I: Send,
impl<'module, 'source, I> Sync for Runtime<'module, 'source, I>where
I: Sync,
impl<'module, 'source, I> Unpin for Runtime<'module, 'source, I>where
I: Unpin,
impl<'module, 'source, I> UnwindSafe for Runtime<'module, 'source, I>where
I: 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