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

pub struct Exports { /* fields omitted */ }
Expand description

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

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")?;

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.