mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-24 06:01:33 +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)
|
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 {
|
pub fn exports(&mut self) -> ExportIter {
|
||||||
ExportIter::new(&self.module, &mut self.inner)
|
ExportIter::new(&self.module, &mut self.inner)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The module used to instantiate this Instance.
|
||||||
pub fn module(&self) -> Module {
|
pub fn module(&self) -> Module {
|
||||||
Module::new(Rc::clone(&self.module))
|
Module::new(Rc::clone(&self.module))
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user