Struct revm::Interpreter
source · [−]pub struct Interpreter {
pub contract: Contract,
pub program_counter: *const u8,
pub memory: Memory,
pub stack: Stack,
pub gas: Gas,
pub return_data_buffer: Bytes,
pub return_range: Range<usize>,
}Fields
contract: ContractContract information and invoking data
program_counter: *const u8Program counter.
memory: MemoryMemory.
stack: StackStack.
gas: Gasleft gas. Memory gas can be found in Memory field.
return_data_buffer: BytesAfter call returns, its return data is saved here.
return_range: Range<usize>Return value.
Implementations
sourceimpl Interpreter
impl Interpreter
pub fn new<SPEC: Spec>(contract: Contract, gas_limit: u64) -> Self
pub fn contract(&self) -> &Contract
pub fn gas(&self) -> &Gas
pub fn add_next_gas_block(&mut self, pc: usize) -> Return
sourcepub fn program_counter(&self) -> usize
pub fn program_counter(&self) -> usize
Return a reference of the program counter.
sourcepub fn run<H: Host, SPEC: Spec>(&mut self, host: &mut H) -> Return
pub fn run<H: Host, SPEC: Spec>(&mut self, host: &mut H) -> Return
loop steps until we are finished with execution
sourcepub fn return_value(&self) -> Bytes
pub fn return_value(&self) -> Bytes
Copy and get the return value of the interp, if any.
Auto Trait Implementations
impl RefUnwindSafe for Interpreter
impl !Send for Interpreter
impl !Sync for Interpreter
impl Unpin for Interpreter
impl UnwindSafe for Interpreter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more