mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-11 07:08:21 +00:00
feat(deprecated) Port Instance::func.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user