pub trait SupportMachine: CoreMachine {
Show 15 methods
// Required methods
fn cycles(&self) -> u64;
fn set_cycles(&mut self, cycles: u64);
fn max_cycles(&self) -> u64;
fn set_max_cycles(&mut self, cycles: u64);
fn running(&self) -> bool;
fn set_running(&mut self, running: bool);
fn reset(&mut self, max_cycles: u64);
fn reset_signal(&mut self) -> bool;
// Provided methods
fn add_cycles(&mut self, cycles: u64) -> Result<(), Error> { ... }
fn add_cycles_no_checking(&mut self, cycles: u64) -> Result<(), Error> { ... }
fn load_elf_inner(
&mut self,
program: &Bytes,
update_pc: bool,
) -> Result<u64, Error> { ... }
fn load_elf(
&mut self,
program: &Bytes,
update_pc: bool,
) -> Result<u64, Error> { ... }
fn load_binary_inner(
&mut self,
program: &Bytes,
metadata: &ProgramMetadata,
update_pc: bool,
) -> Result<u64, Error> { ... }
fn load_binary(
&mut self,
program: &Bytes,
metadata: &ProgramMetadata,
update_pc: bool,
) -> Result<u64, Error> { ... }
fn initialize_stack(
&mut self,
args: impl ExactSizeIterator<Item = Result<Bytes, Error>>,
stack_start: u64,
stack_size: u64,
) -> Result<u64, Error> { ... }
}
Expand description
This traits extend on top of CoreMachine by adding additional support such as ELF range, cycles which might be needed on Rust side of the logic, such as runner or syscall implementations.
Required Methods§
fn cycles(&self) -> u64
fn set_cycles(&mut self, cycles: u64)
fn max_cycles(&self) -> u64
fn set_max_cycles(&mut self, cycles: u64)
fn running(&self) -> bool
fn set_running(&mut self, running: bool)
fn reset(&mut self, max_cycles: u64)
fn reset_signal(&mut self) -> bool
Provided Methods§
fn add_cycles(&mut self, cycles: u64) -> Result<(), Error>
fn add_cycles_no_checking(&mut self, cycles: u64) -> Result<(), Error>
fn load_elf_inner( &mut self, program: &Bytes, update_pc: bool, ) -> Result<u64, Error>
fn load_elf(&mut self, program: &Bytes, update_pc: bool) -> Result<u64, Error>
fn load_binary_inner( &mut self, program: &Bytes, metadata: &ProgramMetadata, update_pc: bool, ) -> Result<u64, Error>
fn load_binary( &mut self, program: &Bytes, metadata: &ProgramMetadata, update_pc: bool, ) -> Result<u64, Error>
fn initialize_stack( &mut self, args: impl ExactSizeIterator<Item = Result<Bytes, Error>>, stack_start: u64, stack_size: u64, ) -> Result<u64, Error>
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.