[−][src]Struct wasmer_runtime_core_fl::instance::Exports
Exports
is used to get exports like Func
s, DynFunc
s, Memory
s,
Global
s, and Table
s 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]
Important 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); }
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,