Struct revm_primitives::bytecode::ValidJumpAddress
source · pub struct ValidJumpAddress {
pub first_gas_block: u32,
pub analysis: Arc<Vec<AnalysisData>>,
}
Expand description
Mapping of valid jump destination from code.
Fields§
§first_gas_block: u32
§analysis: Arc<Vec<AnalysisData>>
Rc is used here so that we dont need to copy vector. We can move it to more suitable more accessable structure without copying underlying vec.
Implementations§
source§impl ValidJumpAddress
impl ValidJumpAddress
pub fn new(analysis: Arc<Vec<AnalysisData>>, first_gas_block: u32) -> Self
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Get the length of the valid mapping. This is the same as the code bytes.
sourcepub fn is_valid(&self, position: usize) -> bool
pub fn is_valid(&self, position: usize) -> bool
Returns true
if the position is a valid jump destination. If
not, returns false
.
pub fn gas_block(&self, position: usize) -> u64
Trait Implementations§
source§impl Clone for ValidJumpAddress
impl Clone for ValidJumpAddress
source§fn clone(&self) -> ValidJumpAddress
fn clone(&self) -> ValidJumpAddress
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ValidJumpAddress
impl Debug for ValidJumpAddress
source§impl PartialEq<ValidJumpAddress> for ValidJumpAddress
impl PartialEq<ValidJumpAddress> for ValidJumpAddress
source§fn eq(&self, other: &ValidJumpAddress) -> bool
fn eq(&self, other: &ValidJumpAddress) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.