Trait wasmer::Exportable
source · [−]pub trait Exportable<'a>: Sized {
fn to_export(&self) -> Export;
fn get_self_from_extern(
_extern: &'a Extern
) -> Result<&'a Self, ExportError>;
fn into_weak_instance_ref(&mut self);
}
Expand description
This trait is used to mark types as gettable from an Instance
.
Required methods
fn get_self_from_extern(_extern: &'a Extern) -> Result<&'a Self, ExportError>
fn get_self_from_extern(_extern: &'a Extern) -> Result<&'a Self, ExportError>
Implementation of how to get the export corresponding to the implementing type
from an Instance
by name.
fn into_weak_instance_ref(&mut self)
fn into_weak_instance_ref(&mut self)
Convert the extern internally to hold a weak reference to the InstanceRef
.
This is useful for preventing cycles, for example for data stored in a
type implementing WasmerEnv
.