feat(deprecated) Wrap a new module.

This commit is contained in:
Ivan Enderlin
2020-05-22 11:18:05 +02:00
parent 473da3de7d
commit faa1bc3158
3 changed files with 10 additions and 12 deletions

View File

@@ -1,9 +1,4 @@
mod new { use crate::{new, types::Value};
pub(crate) use wasm_common::entity::EntityRef;
pub(crate) use wasmer::Instance;
}
use crate::types::Value;
use std::{convert::Infallible, error::Error}; use std::{convert::Infallible, error::Error};
pub struct Instance { pub struct Instance {
@@ -14,7 +9,7 @@ pub struct Instance {
pub module: (), pub module: (),
// TODO // TODO
//pub exports: Exports, //pub exports: Exports,
pub(crate) new_instance: new::Instance, pub(crate) new_instance: new::wasmer::Instance,
} }
impl Instance { impl Instance {
@@ -39,7 +34,7 @@ impl Instance {
note = "Please use `instance.module().info().resolve_func(name)` instead." note = "Please use `instance.module().info().resolve_func(name)` instead."
)] )]
pub fn resolve_func(&self, name: &str) -> Result<usize, ()> { pub fn resolve_func(&self, name: &str) -> Result<usize, ()> {
use self::new::EntityRef; use new::wasm_common::entity::EntityRef;
self.new_instance self.new_instance
.module() .module()

View File

@@ -1,4 +1,9 @@
mod instance; mod instance;
pub mod types; pub mod types;
mod new {
pub(crate) use wasm_common;
pub(crate) use wasmer;
}
pub use crate::instance::Instance; pub use crate::instance::Instance;

View File

@@ -1,5 +1,3 @@
mod new { use crate::new;
pub(crate) use wasmer::Val;
}
pub type Value = new::Val; pub type Value = new::wasmer::Val;