pub struct BasicInstructionFetcher<Instruction, CustomError>where
Instruction: BaseInstruction,{ /* private fields */ }Expand description
Basic instruction fetcher implementation
Implementations§
Source§impl<Instruction, CustomError> BasicInstructionFetcher<Instruction, CustomError>where
Instruction: BaseInstruction,
[(); <Instruction::Reg>::N]:,
impl<Instruction, CustomError> BasicInstructionFetcher<Instruction, CustomError>where
Instruction: BaseInstruction,
[(); <Instruction::Reg>::N]:,
Sourcepub unsafe fn new(
return_trap_address: <<Instruction as BaseInstruction>::Reg as Register>::Type,
pc: <<Instruction as BaseInstruction>::Reg as Register>::Type,
) -> Self
pub unsafe fn new( return_trap_address: <<Instruction as BaseInstruction>::Reg as Register>::Type, pc: <<Instruction as BaseInstruction>::Reg as Register>::Type, ) -> 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 end with a jump instruction.
Trait Implementations§
Source§impl<Instruction, CustomError: Clone> Clone for BasicInstructionFetcher<Instruction, CustomError>where
Instruction: BaseInstruction + Clone,
impl<Instruction, CustomError: Clone> Clone for BasicInstructionFetcher<Instruction, CustomError>where
Instruction: BaseInstruction + Clone,
Source§fn clone(&self) -> BasicInstructionFetcher<Instruction, CustomError>
fn clone(&self) -> BasicInstructionFetcher<Instruction, CustomError>
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<Instruction, CustomError: Debug> Debug for BasicInstructionFetcher<Instruction, CustomError>where
Instruction: BaseInstruction + Debug,
impl<Instruction, CustomError: Debug> Debug for BasicInstructionFetcher<Instruction, CustomError>where
Instruction: BaseInstruction + Debug,
Source§impl<Instruction, Memory, CustomError> InstructionFetcher<Instruction, Memory, CustomError> for BasicInstructionFetcher<Instruction, CustomError>where
Instruction: BaseInstruction,
Memory: VirtualMemory,
CustomError: Display,
impl<Instruction, Memory, CustomError> InstructionFetcher<Instruction, Memory, CustomError> for BasicInstructionFetcher<Instruction, CustomError>where
Instruction: BaseInstruction,
Memory: VirtualMemory,
CustomError: Display,
Source§fn fetch_instruction(
&mut self,
memory: &mut Memory,
) -> Result<FetchInstructionResult<Instruction>, ExecutionError<Instruction, CustomError>>
fn fetch_instruction( &mut self, memory: &mut Memory, ) -> Result<FetchInstructionResult<Instruction>, ExecutionError<Instruction, CustomError>>
Fetch a single instruction at a specified address and advance the program counter
Source§impl<Instruction, Memory, CustomError> ProgramCounter<<<Instruction as BaseInstruction>::Reg as Register>::Type, Memory, CustomError> for BasicInstructionFetcher<Instruction, CustomError>where
Instruction: BaseInstruction,
Memory: VirtualMemory,
CustomError: Display,
impl<Instruction, Memory, CustomError> ProgramCounter<<<Instruction as BaseInstruction>::Reg as Register>::Type, Memory, CustomError> for BasicInstructionFetcher<Instruction, CustomError>where
Instruction: BaseInstruction,
Memory: VirtualMemory,
CustomError: Display,
Source§fn get_pc(&self) -> <<Instruction as BaseInstruction>::Reg as Register>::Type
fn get_pc(&self) -> <<Instruction as BaseInstruction>::Reg as Register>::Type
Get the current value of the program counter
Source§fn set_pc(
&mut self,
memory: &mut Memory,
pc: <<Instruction as BaseInstruction>::Reg as Register>::Type,
) -> Result<ControlFlow<()>, ProgramCounterError<<<Instruction as BaseInstruction>::Reg as Register>::Type, CustomError>>
fn set_pc( &mut self, memory: &mut Memory, pc: <<Instruction as BaseInstruction>::Reg as Register>::Type, ) -> Result<ControlFlow<()>, ProgramCounterError<<<Instruction as BaseInstruction>::Reg as Register>::Type, CustomError>>
Set the current value of the program counter
impl<Instruction, CustomError: Copy> Copy for BasicInstructionFetcher<Instruction, CustomError>where
Instruction: BaseInstruction + Copy,
Auto Trait Implementations§
impl<Instruction, CustomError> Freeze for BasicInstructionFetcher<Instruction, CustomError>where
<<Instruction as BaseInstruction>::Reg as Register>::Type: Freeze,
impl<Instruction, CustomError> RefUnwindSafe for BasicInstructionFetcher<Instruction, CustomError>where
<<Instruction as BaseInstruction>::Reg as Register>::Type: RefUnwindSafe,
CustomError: RefUnwindSafe,
impl<Instruction, CustomError> Send for BasicInstructionFetcher<Instruction, CustomError>
impl<Instruction, CustomError> Sync for BasicInstructionFetcher<Instruction, CustomError>
impl<Instruction, CustomError> Unpin for BasicInstructionFetcher<Instruction, CustomError>
impl<Instruction, CustomError> UnwindSafe for BasicInstructionFetcher<Instruction, CustomError>where
<<Instruction as BaseInstruction>::Reg as Register>::Type: UnwindSafe,
CustomError: UnwindSafe,
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