feat(deprecated) Port DynFunc and Instance::dyn_func.

This commit is contained in:
Ivan Enderlin
2020-07-02 12:13:11 +02:00
parent 2d65ff5b72
commit ee28303932

View File

@@ -8,6 +8,8 @@ use std::{
rc::Rc,
};
pub use crate::typed_func::DynamicFunc as DynFunc;
#[derive(Debug)]
pub(crate) struct PreInstance {
pub(crate) vmctx: Rc<RefCell<vm::Ctx>>,
@@ -56,6 +58,10 @@ impl Instance {
Err(())
}
pub fn dyn_func(&self, name: &str) -> Result<DynFunc, ExportError> {
self.exports.get(name)
}
pub fn resolve_func(&self, name: &str) -> Result<usize, ()> {
self.new_instance
.module()