pub trait StackTr {
Show 14 methods
// Required methods
fn len(&self) -> usize;
fn data(&self) -> &[U256] ⓘ;
fn clear(&mut self);
fn push(&mut self, value: U256) -> bool;
fn push_slice(&mut self, slice: &[u8]) -> bool;
fn popn<const N: usize>(&mut self) -> Option<[U256; N]>;
fn popn_top<const POPN: usize>(
&mut self,
) -> Option<([U256; POPN], &mut U256)>;
fn exchange(&mut self, n: usize, m: usize) -> bool;
fn dup(&mut self, n: usize) -> bool;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn push_b256(&mut self, value: B256) -> bool { ... }
fn top(&mut self) -> Option<&mut U256> { ... }
fn pop(&mut self) -> Option<U256> { ... }
fn pop_address(&mut self) -> Option<Address> { ... }
}Expand description
Functions needed for Interpreter Stack operations.
Required Methods§
Sourcefn push(&mut self, value: U256) -> bool
fn push(&mut self, value: U256) -> bool
Pushes values to the stack.
Returns true if push was successful, false if stack overflow.
§Note
Error is internally set in interpreter.
Sourcefn push_slice(&mut self, slice: &[u8]) -> bool
fn push_slice(&mut self, slice: &[u8]) -> bool
Pushes slice to the stack.
Returns true if push was successful, false if stack overflow.
§Note
Error is internally set in interpreter.
Sourcefn popn_top<const POPN: usize>(&mut self) -> Option<([U256; POPN], &mut U256)>
fn popn_top<const POPN: usize>(&mut self) -> Option<([U256; POPN], &mut U256)>
Pop N values from the stack and return top value.
Provided Methods§
Sourcefn push_b256(&mut self, value: B256) -> bool
fn push_b256(&mut self, value: B256) -> bool
Pushes B256 value to the stack.
Internally converts B256 to U256 and then calls StackTr::push.
Sourcefn pop_address(&mut self) -> Option<Address>
fn pop_address(&mut self) -> Option<Address>
Pops address from the stack.
Internally call StackTr::pop and converts U256 into Address.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.