[][src]Struct wasmer_runtime_core_fl::instance::Exports

pub struct Exports { /* fields omitted */ }

Exports is used to get exports like Funcs, DynFuncs, Memorys, Globals, and Tables from an Instance.

Use Instance.exports to get an Exports from an Instance.

Implementations

impl Exports[src]

pub fn get<'a, T: Exportable<'a>>(&'a self, name: &str) -> ResolveResult<T>[src]

Get an export.

// We can get a function as a static `Func`
let func: Func<i32, i32> = instance.exports.get("my_func")?;
let _result = func.call(42);

// Or we can get it as a dynamic `DynFunc`
let dyn_func: DynFunc = instance.exports.get("my_func")?;
let _result= dyn_func.call(&[Value::I32(42)]);

// We can also get other exports like `Global`s, `Memory`s, and `Table`s
let _counter: Global = instance.exports.get("counter")?;

pub fn into_iter(&self) -> ExportIter

Important traits for ExportIter<'a>

impl<'a> Iterator for ExportIter<'a> type Item = (String, Export);
[src]

Iterate the exports.

for (export_name, export_value) in instance.exports.into_iter() {
   println!("Found export `{}` with value `{:?}`", export_name, export_value);
}

Trait Implementations

Auto Trait Implementations

impl !RefUnwindSafe for Exports

impl !Sync for Exports

impl Unpin for Exports

impl !UnwindSafe for Exports

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.