mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-12 13:28:49 +00:00
feat(depreacted) Port Exports and Instance.exports.
This commit is contained in:
@@ -1,14 +1,20 @@
|
|||||||
use crate::{module::Module, new, structures::TypedIndex, types::Value};
|
use crate::{module::Module, new, structures::TypedIndex, types::Value};
|
||||||
use std::{convert::Infallible, error::Error};
|
use std::{convert::Infallible, error::Error};
|
||||||
|
|
||||||
|
pub use new::wasmer::Exports;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Instance {
|
pub struct Instance {
|
||||||
|
pub exports: Exports,
|
||||||
pub(crate) new_instance: new::wasmer::Instance,
|
pub(crate) new_instance: new::wasmer::Instance,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Instance {
|
impl Instance {
|
||||||
pub(crate) fn new(new_instance: new::wasmer::Instance) -> Self {
|
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, ()> {
|
pub fn load<T>(&self, _loader: T) -> Result<Self, ()> {
|
||||||
@@ -45,8 +51,8 @@ impl Instance {
|
|||||||
.into_vec())
|
.into_vec())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn exports(&self) -> &new::wasmer::Exports {
|
pub fn exports(&self) -> Exports {
|
||||||
&self.new_instance.exports
|
self.exports.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn module(&self) -> Module {
|
pub fn module(&self) -> Module {
|
||||||
|
|||||||
Reference in New Issue
Block a user