pub struct Machine { /* private fields */ }Expand description
Core execution layer for EVM.
Implementations§
Source§impl Machine
impl Machine
Sourcepub const fn memory_mut(&mut self) -> &mut Memory
pub const fn memory_mut(&mut self) -> &mut Memory
Mutable reference of machine memory.
Sourcepub const fn position(&self) -> &Result<usize, ExitReason>
pub const 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.
Auto Trait Implementations§
impl Freeze for Machine
impl RefUnwindSafe for Machine
impl !Send for Machine
impl !Sync for Machine
impl Unpin for Machine
impl UnwindSafe for Machine
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