pub(crate) trait Architecturewhere
Self: Sized,{
// Required methods
fn compile(program: &[Instruction; 512]) -> Result<Self, CompilerError>;
fn invoke(&self, regs: &mut RegisterFile);
}
Expand description
Trait that adds architecture-specific functionality to Executable
Required Methods§
Sourcefn compile(program: &[Instruction; 512]) -> Result<Self, CompilerError>
fn compile(program: &[Instruction; 512]) -> Result<Self, CompilerError>
Compile an array of instructions into an Executable
Sourcefn invoke(&self, regs: &mut RegisterFile)
fn invoke(&self, regs: &mut RegisterFile)
Run the compiled code, with a RegisterFile for input and output
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl Architecture for Executable
Available on crate feature
compiler
and x86-64 only.