pub struct EagerTestInstructionFetcher { /* private fields */ }Expand description
Eager instruction handler eagerly decodes all instructions upfront
Implementations§
Source§impl EagerTestInstructionFetcher
impl EagerTestInstructionFetcher
Sourcepub unsafe fn new(
instructions: Vec<ContractInstruction>,
return_trap_address: u64,
base_addr: u64,
pc: u64,
) -> Self
pub unsafe fn new( instructions: Vec<ContractInstruction>, return_trap_address: u64, base_addr: u64, pc: u64, ) -> Self
Create a new instance with the specified instructions and base address.
Instructions are in the same order as they appear in the binary, and the base address corresponds to the first instruction.
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 end with a jump instruction.
Trait Implementations§
Source§impl Clone for EagerTestInstructionFetcher
impl Clone for EagerTestInstructionFetcher
Source§fn clone(&self) -> EagerTestInstructionFetcher
fn clone(&self) -> EagerTestInstructionFetcher
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 EagerTestInstructionFetcher
impl Debug for EagerTestInstructionFetcher
Source§impl Default for EagerTestInstructionFetcher
impl Default for EagerTestInstructionFetcher
Source§fn default() -> EagerTestInstructionFetcher
fn default() -> EagerTestInstructionFetcher
Returns the “default value” for a type. Read more
Source§impl<Memory> InstructionFetcher<ContractInstructionPrototype<EReg<u64>>, Memory, &'static str> for EagerTestInstructionFetcherwhere
Memory: VirtualMemory,
impl<Memory> InstructionFetcher<ContractInstructionPrototype<EReg<u64>>, Memory, &'static str> for EagerTestInstructionFetcherwhere
Memory: VirtualMemory,
Source§fn fetch_instruction(
&mut self,
_memory: &mut Memory,
) -> Result<FetchInstructionResult<ContractInstruction>, ExecutionError<u64, ContractInstruction, &'static str>>
fn fetch_instruction( &mut self, _memory: &mut Memory, ) -> Result<FetchInstructionResult<ContractInstruction>, ExecutionError<u64, ContractInstruction, &'static str>>
Fetch a single instruction at a specified address and advance the program counter
Source§impl<Memory> ProgramCounter<u64, Memory, &'static str> for EagerTestInstructionFetcherwhere
Memory: VirtualMemory,
impl<Memory> ProgramCounter<u64, Memory, &'static str> for EagerTestInstructionFetcherwhere
Memory: VirtualMemory,
Source§fn set_pc(
&mut self,
_memory: &mut Memory,
pc: u64,
) -> Result<ControlFlow<()>, ProgramCounterError<u64, &'static str>>
fn set_pc( &mut self, _memory: &mut Memory, pc: u64, ) -> Result<ControlFlow<()>, ProgramCounterError<u64, &'static str>>
Set the current value of the program counter
Auto Trait Implementations§
impl Freeze for EagerTestInstructionFetcher
impl RefUnwindSafe for EagerTestInstructionFetcher
impl Send for EagerTestInstructionFetcher
impl Sync for EagerTestInstructionFetcher
impl Unpin for EagerTestInstructionFetcher
impl UnwindSafe for EagerTestInstructionFetcher
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