pub trait Executable {
// Required methods
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§
Sourcefn load(
&self,
engine: &(dyn Engine + 'static),
) -> Result<Arc<dyn Artifact>, CompileError>
fn load( &self, engine: &(dyn Engine + 'static), ) -> Result<Arc<dyn Artifact>, CompileError>
Load this executable with the specified engine.
TODO(0-copy): change error type here.
Sourcefn cpu_features(&self) -> EnumSet<CpuFeature>
fn cpu_features(&self) -> EnumSet<CpuFeature>
The CPU features this Executable
requires.
Sourcefn serialize(&self) -> Result<Vec<u8>, Box<dyn Error + Send + Sync>>
fn serialize(&self) -> Result<Vec<u8>, Box<dyn Error + Send + Sync>>
Serializes the artifact into bytes
Sourcefn 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§
Source§impl 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.