pub struct Machine { /* private fields */ }
Expand description
Core execution layer for EVM.
Implementations
sourceimpl Machine
impl Machine
sourcepub fn memory_mut(&mut self) -> &mut Memory
pub fn memory_mut(&mut self) -> &mut Memory
Mutable reference of machine memory.
sourcepub fn position(&self) -> &Result<usize, ExitReason>
pub fn position(&self) -> &Result<usize, ExitReason>
Return a reference of the program counter.
sourcepub fn new(
code: Rc<Vec<u8>>,
data: Rc<Vec<u8>>,
stack_limit: usize,
memory_limit: usize
) -> Self
pub fn new(
code: Rc<Vec<u8>>,
data: Rc<Vec<u8>>,
stack_limit: usize,
memory_limit: usize
) -> Self
Create a new machine with given code and data.
sourcepub fn exit(&mut self, reason: ExitReason)
pub fn exit(&mut self, reason: ExitReason)
Explicit exit of the machine. Further step will return error.
sourcepub fn inspect(&self) -> Option<(Opcode, &Stack)>
pub fn inspect(&self) -> Option<(Opcode, &Stack)>
Inspect the machine’s next opcode and current stack.
sourcepub fn return_value(&self) -> Vec<u8>
pub fn return_value(&self) -> Vec<u8>
Copy and get the return value of the machine, if any.
sourcepub fn run(&mut self) -> Capture<ExitReason, Trap>
pub fn run(&mut self) -> Capture<ExitReason, Trap>
Loop stepping the machine, until it stops.
Auto Trait Implementations
impl RefUnwindSafe for Machine
impl !Send for Machine
impl !Sync for Machine
impl Unpin for Machine
impl UnwindSafe for Machine
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