Trait wasmer_engine::Executable
source · [−]pub trait Executable {
fn load(
&self,
engine: &(dyn Engine + 'static)
) -> Result<Arc<dyn Artifact>, CompileError>;
fn features(&self) -> Features;
fn cpu_features(&self) -> EnumSet<CpuFeature>;
fn serialize(&self) -> Result<Vec<u8>, Box<dyn Error + Send + Sync>>;
fn function_name(&self, index: FunctionIndex) -> Option<&str>;
}
Expand description
Required Methods
Load this executable with the specified engine.
TODO(0-copy): change error type here.
fn cpu_features(&self) -> EnumSet<CpuFeature>
fn cpu_features(&self) -> EnumSet<CpuFeature>
The CPU features this Executable
requires.
Serializes the artifact into bytes
fn function_name(&self, index: FunctionIndex) -> Option<&str>
fn function_name(&self, index: FunctionIndex) -> Option<&str>
Obtain a best effort description for the function at the given function index.
Implementations are not required to maintain symbol names, so this may always return None.
Implementations
sourceimpl dyn Executable
impl dyn Executable
sourcepub fn downcast_ref<T: Executable + 'static>(&self) -> Option<&T>
pub fn downcast_ref<T: Executable + 'static>(&self) -> Option<&T>
Downcast a dynamic Executable object to a concrete implementation of the trait.