Trait SupportMachine

Source
pub trait SupportMachine: CoreMachine {
Show 17 methods // Required methods fn new_with_memory( isa: u8, version: u32, max_cycles: u64, memory_size: usize, ) -> Self where Self: Sized; 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 new(isa: u8, version: u32, max_cycles: u64) -> Self where Self: Sized { ... } 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§

Source

fn new_with_memory( isa: u8, version: u32, max_cycles: u64, memory_size: usize, ) -> Self
where Self: Sized,

Instantiation function

Source

fn cycles(&self) -> u64

Source

fn set_cycles(&mut self, cycles: u64)

Source

fn max_cycles(&self) -> u64

Source

fn set_max_cycles(&mut self, cycles: u64)

Source

fn running(&self) -> bool

Source

fn set_running(&mut self, running: bool)

Source

fn reset(&mut self, max_cycles: u64)

Source

fn reset_signal(&mut self) -> bool

Provided Methods§

Source

fn new(isa: u8, version: u32, max_cycles: u64) -> Self
where Self: Sized,

Instantiate using default memory size

Source

fn add_cycles(&mut self, cycles: u64) -> Result<(), Error>

Source

fn add_cycles_no_checking(&mut self, cycles: u64) -> Result<(), Error>

Source

fn load_elf_inner( &mut self, program: &Bytes, update_pc: bool, ) -> Result<u64, Error>

Source

fn load_elf(&mut self, program: &Bytes, update_pc: bool) -> Result<u64, Error>

Source

fn load_binary_inner( &mut self, program: &Bytes, metadata: &ProgramMetadata, update_pc: bool, ) -> Result<u64, Error>

Source

fn load_binary( &mut self, program: &Bytes, metadata: &ProgramMetadata, update_pc: bool, ) -> Result<u64, Error>

Source

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.

Implementors§