pub struct Stack { /* private fields */ }Expand description
EVM stack.
Implementations
sourceimpl Stack
impl Stack
pub fn reduce_one(&mut self) -> Return
sourcepub fn pop(&mut self) -> Result<U256, Return>
pub fn pop(&mut self) -> Result<U256, Return>
Pop a value from the stack. If the stack is already empty, returns the
StackUnderflow error.
sourcepub unsafe fn pop_unsafe(&mut self) -> U256
pub unsafe fn pop_unsafe(&mut self) -> U256
Pops a value from the stack, returning it.
Safety
The caller is responsible to check length of array
sourcepub unsafe fn top_unsafe(&mut self) -> &mut U256
pub unsafe fn top_unsafe(&mut self) -> &mut U256
sourcepub unsafe fn pop_top_unsafe(&mut self) -> (U256, &mut U256)
pub unsafe fn pop_top_unsafe(&mut self) -> (U256, &mut U256)
Pop the topmost value, returning the value and the new topmost value.
Safety
The caller is responsible to check length of array
sourcepub unsafe fn pop2_top_unsafe(&mut self) -> (U256, U256, &mut U256)
pub unsafe fn pop2_top_unsafe(&mut self) -> (U256, U256, &mut U256)
Pops 2 values from the stack and returns them, in addition to the new topmost value.
Safety
The caller is responsible to check length of array
sourcepub fn push_h256(&mut self, value: H256) -> Result<(), Return>
pub fn push_h256(&mut self, value: H256) -> Result<(), Return>
Push a new value into the stack. If it will exceed the stack limit,
returns StackOverflow error and leaves the stack unchanged.
sourcepub fn push(&mut self, value: U256) -> Result<(), Return>
pub fn push(&mut self, value: U256) -> Result<(), Return>
Push a new value into the stack. If it will exceed the stack limit,
returns StackOverflow error and leaves the stack unchanged.
sourcepub fn peek(&self, no_from_top: usize) -> Result<U256, Return>
pub fn peek(&self, no_from_top: usize) -> Result<U256, Return>
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.
pub fn dup<const N: usize>(&mut self) -> Return
pub fn swap<const N: usize>(&mut self) -> Return
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 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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more