feat(depreacted) Port Exports and Instance.exports.

This commit is contained in:
Ivan Enderlin
2020-06-08 15:26:18 +02:00
parent 3ab503b7eb
commit 3b30f295f2

View File

@@ -1,14 +1,20 @@
use crate::{module::Module, new, structures::TypedIndex, types::Value};
use std::{convert::Infallible, error::Error};
pub use new::wasmer::Exports;
#[derive(Clone)]
pub struct Instance {
pub exports: Exports,
pub(crate) new_instance: new::wasmer::Instance,
}
impl Instance {
pub(crate) fn new(new_instance: new::wasmer::Instance) -> Self {
Self { new_instance }
Self {
exports: new_instance.exports.clone(),
new_instance,
}
}
pub fn load<T>(&self, _loader: T) -> Result<Self, ()> {
@@ -45,8 +51,8 @@ impl Instance {
.into_vec())
}
pub fn exports(&self) -> &new::wasmer::Exports {
&self.new_instance.exports
pub fn exports(&self) -> Exports {
self.exports.clone()
}
pub fn module(&self) -> Module {