Struct ckb_vm::machine::DefaultCoreMachine
source · [−]pub struct DefaultCoreMachine<R, M> { /* private fields */ }Implementations
sourceimpl<R: Register, M: Memory + Default> DefaultCoreMachine<R, M>
impl<R: Register, M: Memory + Default> DefaultCoreMachine<R, M>
pub fn new(isa: u8, version: u32, max_cycles: u64) -> Self
pub fn set_max_cycles(&mut self, cycles: u64)
pub fn take_memory(self) -> M
Trait Implementations
sourceimpl<R: Register, M: Memory<REG = R>> CoreMachine for DefaultCoreMachine<R, M>
impl<R: Register, M: Memory<REG = R>> CoreMachine for DefaultCoreMachine<R, M>
type REG = R
type MEM = M
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
sourceimpl<R: Default, M: Default> Default for DefaultCoreMachine<R, M>
impl<R: Default, M: Default> Default for DefaultCoreMachine<R, M>
sourcefn default() -> DefaultCoreMachine<R, M>
fn default() -> DefaultCoreMachine<R, M>
Returns the “default value” for a type. Read more
sourceimpl<R: Register, M: Memory<REG = R> + Default> SupportMachine for DefaultCoreMachine<R, M>
impl<R: Register, M: Memory<REG = R> + Default> SupportMachine for DefaultCoreMachine<R, M>
fn cycles(&self) -> u64
fn set_cycles(&mut self, cycles: u64)
fn max_cycles(&self) -> 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_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 initialize_stack(
&mut self,
args: &[Bytes],
stack_start: u64,
stack_size: u64
) -> Result<u64, Error>
Auto Trait Implementations
impl<R, M> RefUnwindSafe for DefaultCoreMachine<R, M> where
M: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, M> Send for DefaultCoreMachine<R, M> where
M: Send,
R: Send,
impl<R, M> Sync for DefaultCoreMachine<R, M> where
M: Sync,
R: Sync,
impl<R, M> Unpin for DefaultCoreMachine<R, M> where
M: Unpin,
R: Unpin,
impl<R, M> UnwindSafe for DefaultCoreMachine<R, M> where
M: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more