mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 13:48:26 +00:00
feat(deprecated) Port Instance::exports().
This commit is contained in:
@@ -10,5 +10,6 @@ impl Instance {
|
|||||||
fn call(&self, name: &str, params: &[Value]) -> Result<Vec<Value>, Box<dyn Error>>;
|
fn call(&self, name: &str, params: &[Value]) -> Result<Vec<Value>, Box<dyn Error>>;
|
||||||
fn context(&self) -> Ref<Ctx>;
|
fn context(&self) -> Ref<Ctx>;
|
||||||
fn context_mut(&mut self) -> RefMut<Ctx>;
|
fn context_mut(&mut self) -> RefMut<Ctx>;
|
||||||
|
fn exports(&self) -> ExportsIterator<impl Iterator<Item = (&String, &Export)>>;
|
||||||
fn module(&self) -> Module;
|
fn module(&self) -> Module;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
error::ExportError, export::Exportable, import::LikeNamespace, module::Module, new,
|
error::ExportError,
|
||||||
structures::TypedIndex, typed_func::Func, types::Value, vm,
|
export::{Export, Exportable},
|
||||||
|
import::LikeNamespace,
|
||||||
|
module::Module,
|
||||||
|
new,
|
||||||
|
structures::TypedIndex,
|
||||||
|
typed_func::Func,
|
||||||
|
types::Value,
|
||||||
|
vm,
|
||||||
};
|
};
|
||||||
use std::{
|
use std::{
|
||||||
cell::{Ref, RefCell, RefMut},
|
cell::{Ref, RefCell, RefMut},
|
||||||
@@ -107,6 +114,12 @@ impl Instance {
|
|||||||
pub fn context_mut(&mut self) -> RefMut<vm::Ctx> {
|
pub fn context_mut(&mut self) -> RefMut<vm::Ctx> {
|
||||||
self.pre_instance.vmctx.borrow_mut()
|
self.pre_instance.vmctx.borrow_mut()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn exports(
|
||||||
|
&self,
|
||||||
|
) -> new::wasmer::ExportsIterator<impl Iterator<Item = (&String, &Export)>> {
|
||||||
|
self.new_instance.exports.iter()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LikeNamespace for Instance {
|
impl LikeNamespace for Instance {
|
||||||
|
|||||||
Reference in New Issue
Block a user