Struct evm::PC
[−]
[src]
pub struct PC<'a, P: Patch> { /* fields omitted */ }
Represents a program counter in EVM.
Methods
impl<'a, P: Patch> PC<'a, P>
[src]
fn new(code: &'a [u8], valids: &'a Valids, position: &'a usize) -> Self
[src]
Create a new program counter from the given code.
fn code(&self) -> &[u8]
[src]
Get the code bytearray.
fn position(&self) -> usize
[src]
Get the current program counter position.
fn opcode_position(&self) -> usize
[src]
Get the current opcode position. Should only be used when debugging.
fn is_valid(&self, position: usize) -> bool
[src]
Returns true
if the position is a valid jump destination. If
not, returns false
.
fn is_end(&self) -> bool
[src]
Check whether the PC is ended. Next read
on this PC would
result in PCError::PCOverflow
.
fn peek_opcode(&self) -> Result<Opcode, OnChainError>
[src]
Peek the next opcode.
fn peek(&self) -> Result<Instruction, OnChainError>
[src]
Peek the next instruction.