pub struct Stack { /* private fields */ }
Expand description
Represents an EVM stack.
Implementations
sourceimpl Stack
impl Stack
sourcepub fn check_pop_push(&self, pop: usize, push: usize) -> Result<(), OnChainError>
pub fn check_pop_push(&self, pop: usize, push: usize) -> Result<(), OnChainError>
Check a pop-push cycle. If the check succeeded, push
, pop
,
set
, peek
within the limit should not fail.
sourcepub fn pop(&mut self) -> Result<M256, OnChainError>
pub fn pop(&mut self) -> Result<M256, OnChainError>
Pop a value from the stack.
sourcepub fn set(&mut self, no_from_top: usize, val: M256) -> Result<(), OnChainError>
pub fn set(&mut self, no_from_top: usize, val: M256) -> Result<(), OnChainError>
Set 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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Stack
impl Send for Stack
impl Sync for Stack
impl Unpin for Stack
impl UnwindSafe for Stack
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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