Struct wasmer_runtime_core_fl::instance::Exports [−][src]
pub struct Exports { /* fields omitted */ }
Expand description
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")?;
pub fn into_iter(&self) -> ExportIter<'_>ⓘNotable traits for ExportIter<'a>impl<'a> Iterator for ExportIter<'a> type Item = (String, Export);
pub fn into_iter(&self) -> ExportIter<'_>ⓘNotable traits for ExportIter<'a>impl<'a> Iterator for ExportIter<'a> type Item = (String, Export);
Notable traits for ExportIter<'a>
impl<'a> Iterator for ExportIter<'a> type Item = (String, Export);
Iterate the exports.
for (export_name, export_value) in instance.exports.into_iter() { println!("Found export `{}` with value `{:?}`", export_name, export_value); }