pub struct LazyInstructionFetcher { /* private fields */ }Expand description
Lazy instruction fetcher implementation
Implementations§
Source§impl LazyInstructionFetcher
impl LazyInstructionFetcher
Sourcepub unsafe fn new(return_trap_address: u64, pc: u64) -> Self
pub unsafe fn new(return_trap_address: u64, pc: u64) -> Self
Create a new instance.
return_trap_address is the address at which the interpreter will stop execution
(gracefully).
§Safety
The program counter must be valid and aligned, the instructions processed must be valid and end with a jump instruction.
Trait Implementations§
Source§impl Clone for LazyInstructionFetcher
impl Clone for LazyInstructionFetcher
Source§fn clone(&self) -> LazyInstructionFetcher
fn clone(&self) -> LazyInstructionFetcher
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LazyInstructionFetcher
impl Debug for LazyInstructionFetcher
Source§impl<Memory> InstructionFetcher<ContractInstructionPrototype<Reg<u64>>, Memory> for LazyInstructionFetcherwhere
Memory: VirtualMemory,
impl<Memory> InstructionFetcher<ContractInstructionPrototype<Reg<u64>>, Memory> for LazyInstructionFetcherwhere
Memory: VirtualMemory,
Source§fn fetch_instruction(
&mut self,
memory: &Memory,
) -> Result<FetchInstructionResult<ContractInstruction>, ExecutionError<u64>>
fn fetch_instruction( &mut self, memory: &Memory, ) -> Result<FetchInstructionResult<ContractInstruction>, ExecutionError<u64>>
Fetch a single instruction at a specified address and advance the program counter on
successful fetch
Source§impl<Memory> ProgramCounter<u64, Memory> for LazyInstructionFetcherwhere
Memory: VirtualMemory,
impl<Memory> ProgramCounter<u64, Memory> for LazyInstructionFetcherwhere
Memory: VirtualMemory,
Source§fn set_pc(
&mut self,
memory: &Memory,
pc: u64,
) -> Result<ControlFlow<()>, ProgramCounterError<u64>>
fn set_pc( &mut self, memory: &Memory, pc: u64, ) -> Result<ControlFlow<()>, ProgramCounterError<u64>>
Set the current value of the program counter
impl Copy for LazyInstructionFetcher
Auto Trait Implementations§
impl Freeze for LazyInstructionFetcher
impl RefUnwindSafe for LazyInstructionFetcher
impl Send for LazyInstructionFetcher
impl Sync for LazyInstructionFetcher
impl Unpin for LazyInstructionFetcher
impl UnsafeUnpin for LazyInstructionFetcher
impl UnwindSafe for LazyInstructionFetcher
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more