Struct ckb_vm::machine::DefaultMachine
source · pub struct DefaultMachine<Inner> { /* private fields */ }
Implementations§
source§impl<Inner: SupportMachine> DefaultMachine<Inner>
impl<Inner: SupportMachine> DefaultMachine<Inner>
pub fn load_program( &mut self, program: &Bytes, args: &[Bytes], ) -> Result<u64, Error>
pub fn load_program_with_metadata( &mut self, program: &Bytes, metadata: &ProgramMetadata, args: &[Bytes], ) -> Result<u64, Error>
pub fn take_inner(self) -> Inner
pub fn pause(&self) -> Pause
pub fn set_pause(&mut self, pause: Pause)
pub fn exit_code(&self) -> i8
pub fn instruction_cycle_func(&self) -> &InstructionCycleFunc
pub fn inner_mut(&mut self) -> &mut Inner
pub fn run(&mut self) -> Result<i8, Error>
pub fn step(&mut self, decoder: &mut Decoder) -> Result<(), Error>
Trait Implementations§
source§impl<Inner: CoreMachine> CoreMachine for DefaultMachine<Inner>
impl<Inner: CoreMachine> CoreMachine for DefaultMachine<Inner>
type REG = <Inner as CoreMachine>::REG
type MEM = <Inner as CoreMachine>::MEM
fn pc(&self) -> &Self::REG
fn update_pc(&mut self, pc: Self::REG)
fn commit_pc(&mut self)
fn memory(&self) -> &Self::MEM
fn memory_mut(&mut self) -> &mut Self::MEM
fn registers(&self) -> &[Self::REG]
fn set_register(&mut self, idx: usize, value: Self::REG)
fn isa(&self) -> u8
fn version(&self) -> u32
source§impl<Inner: CoreMachine> Display for DefaultMachine<Inner>
impl<Inner: CoreMachine> Display for DefaultMachine<Inner>
source§impl<Inner: SupportMachine> Machine for DefaultMachine<Inner>
impl<Inner: SupportMachine> Machine for DefaultMachine<Inner>
source§impl<Inner: SupportMachine> SupportMachine for DefaultMachine<Inner>
impl<Inner: SupportMachine> SupportMachine for DefaultMachine<Inner>
fn cycles(&self) -> u64
fn set_cycles(&mut self, cycles: u64)
fn max_cycles(&self) -> u64
fn set_max_cycles(&mut self, max_cycles: u64)
fn reset(&mut self, max_cycles: u64)
fn reset_signal(&mut self) -> bool
fn running(&self) -> bool
fn set_running(&mut self, running: bool)
fn load_binary( &mut self, program: &Bytes, metadata: &ProgramMetadata, update_pc: bool, ) -> Result<u64, Error>
fn load_elf(&mut self, program: &Bytes, update_pc: bool) -> Result<u64, Error>
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_binary_inner( &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>
Auto Trait Implementations§
impl<Inner> Freeze for DefaultMachine<Inner>where
Inner: Freeze,
impl<Inner> !RefUnwindSafe for DefaultMachine<Inner>
impl<Inner> Send for DefaultMachine<Inner>where
Inner: Send,
impl<Inner> Sync for DefaultMachine<Inner>where
Inner: Sync,
impl<Inner> Unpin for DefaultMachine<Inner>where
Inner: Unpin,
impl<Inner> !UnwindSafe for DefaultMachine<Inner>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more