Trait ckb_vm::machine::SupportMachine
source · 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: &[Bytes],
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.