Struct ckb_vm::machine::DefaultCoreMachine

source ·
pub struct DefaultCoreMachine<R, M> { /* private fields */ }

Implementations§

source§

impl<R: Register, M: Memory> DefaultCoreMachine<R, M>

source

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

source

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

source

pub fn set_max_cycles(&mut self, cycles: u64)

source

pub fn take_memory(self) -> M

Trait Implementations§

source§

impl<R: Register, M: Memory<REG = R>> CoreMachine for DefaultCoreMachine<R, M>

§

type REG = R

§

type MEM = M

source§

fn pc(&self) -> &Self::REG

source§

fn update_pc(&mut self, pc: Self::REG)

source§

fn commit_pc(&mut self)

source§

fn memory(&self) -> &Self::MEM

source§

fn memory_mut(&mut self) -> &mut Self::MEM

source§

fn registers(&self) -> &[Self::REG]

source§

fn set_register(&mut self, idx: usize, value: Self::REG)

source§

fn isa(&self) -> u8

source§

fn version(&self) -> u32

source§

impl<R: Default, M: Default> Default for DefaultCoreMachine<R, M>

source§

fn default() -> DefaultCoreMachine<R, M>

Returns the “default value” for a type. Read more
source§

impl<R: Register, M: Memory<REG = R>> SupportMachine for DefaultCoreMachine<R, M>

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, max_cycles: u64)

source§

fn reset(&mut self, max_cycles: u64)

source§

fn reset_signal(&mut self) -> bool

source§

fn running(&self) -> bool

source§

fn set_running(&mut self, running: bool)

source§

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

source§

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

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_binary_inner( &mut self, program: &Bytes, metadata: &ProgramMetadata, update_pc: bool, ) -> Result<u64, Error>

source§

fn initialize_stack( &mut self, args: &[Bytes], stack_start: u64, stack_size: u64, ) -> Result<u64, Error>

Auto Trait Implementations§

§

impl<R, M> Freeze for DefaultCoreMachine<R, M>
where R: Freeze, M: Freeze,

§

impl<R, M> RefUnwindSafe for DefaultCoreMachine<R, M>

§

impl<R, M> Send for DefaultCoreMachine<R, M>
where R: Send, M: Send,

§

impl<R, M> Sync for DefaultCoreMachine<R, M>
where R: Sync, M: Sync,

§

impl<R, M> Unpin for DefaultCoreMachine<R, M>
where R: Unpin, M: Unpin,

§

impl<R, M> UnwindSafe for DefaultCoreMachine<R, M>
where R: UnwindSafe, M: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.