feat(deprecated) Port Instance::func.

This commit is contained in:
Ivan Enderlin
2020-07-02 12:48:03 +02:00
parent 483279b6ba
commit ed8bdf269d

View File

@@ -1,6 +1,6 @@
use crate::{
error::ExportError, export::Exportable, import::LikeNamespace, module::Module, new,
structures::TypedIndex, types::Value, vm,
structures::TypedIndex, typed_func::Func, types::Value, vm,
};
use std::{
cell::{Ref, RefCell, RefMut},
@@ -58,6 +58,14 @@ impl Instance {
Err(())
}
pub fn func<Args, Rets>(&self, name: &str) -> Result<Func<Args, Rets>, ExportError>
where
Args: new::wasmer::WasmTypeList + Clone,
Rets: new::wasmer::WasmTypeList + Clone,
{
self.exports.get(name)
}
pub fn dyn_func(&self, name: &str) -> Result<DynFunc, ExportError> {
self.exports.get(name)
}