mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-13 00:51:20 +00:00
Add context and context_mut methods to Instance
This commit is contained in:
@ -159,10 +159,29 @@ impl Instance {
|
||||
self.call_with_index(func_index, args)
|
||||
}
|
||||
|
||||
/// Returns a immutable reference to the
|
||||
/// [`Ctx`] used by this Instance.
|
||||
///
|
||||
/// [`Ctx`]: struct.Ctx.html
|
||||
pub fn context(&self) -> &vm::Ctx {
|
||||
&self.inner.vmctx
|
||||
}
|
||||
|
||||
/// Returns a mutable reference to the
|
||||
/// [`Ctx`] used by this Instance.
|
||||
///
|
||||
/// [`Ctx`]: struct.Ctx.html
|
||||
pub fn context_mut(&mut self) -> &mut vm::Ctx {
|
||||
&mut self.inner.vmctx
|
||||
}
|
||||
|
||||
/// Returns a iterator over all of the items
|
||||
/// exported from this instance.
|
||||
pub fn exports(&mut self) -> ExportIter {
|
||||
ExportIter::new(&self.module, &mut self.inner)
|
||||
}
|
||||
|
||||
/// The module used to instantiate this Instance.
|
||||
pub fn module(&self) -> Module {
|
||||
Module::new(Rc::clone(&self.module))
|
||||
}
|
||||
|
Reference in New Issue
Block a user