pub struct Stack { /* private fields */ }Expand description
EVM stack.
Implementations§
Source§impl Stack
impl Stack
Sourcepub fn pop(&mut self) -> Result<U256, ExitError>
pub fn pop(&mut self) -> Result<U256, ExitError>
Pop a value from the stack. If the stack is already empty, returns the
StackUnderflow error.
§Errors
Return ExitError
Sourcepub fn push(&mut self, value: U256) -> Result<(), ExitError>
pub fn push(&mut self, value: U256) -> Result<(), ExitError>
Push a new value into the stack. If it will exceed the stack limit,
returns StackOverflow error and leaves the stack unchanged.
§Errors
Return ExitError
Sourcepub fn peek(&self, no_from_top: usize) -> Result<U256, ExitError>
pub fn peek(&self, no_from_top: usize) -> Result<U256, ExitError>
Peek a value at given index for the stack, where the top of
the stack is at index 0. If the index is too large,
StackError::Underflow is returned.
§Errors
Return ExitError
Sourcepub fn peek_h256(&self, no_from_top: usize) -> Result<H256, ExitError>
pub fn peek_h256(&self, no_from_top: usize) -> Result<H256, ExitError>
Peek a value at given index for the stack, where the top of
the stack is at index 0. If the index is too large,
StackError::Underflow is returned.
§Errors
Return ExitError
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stack
impl RefUnwindSafe for Stack
impl Send for Stack
impl Sync for Stack
impl Unpin for Stack
impl UnwindSafe for Stack
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