pub struct BranchNode {
pub stack: Vec<RlpNode>,
pub state_mask: TrieMask,
}
Expand description
A branch node in an Ethereum Merkle Patricia Trie.
Branch node is a 17-element array consisting of 16 slots that correspond to each hexadecimal character and an additional slot for a value. We do exclude the node value since all paths have a fixed size.
Fields§
§stack: Vec<RlpNode>
The collection of RLP encoded children.
state_mask: TrieMask
The bitmask indicating the presence of children at the respective nibble positions
Implementations§
Source§impl BranchNode
impl BranchNode
Sourcepub const fn new(stack: Vec<RlpNode>, state_mask: TrieMask) -> Self
pub const fn new(stack: Vec<RlpNode>, state_mask: TrieMask) -> Self
Creates a new branch node with the given stack and state mask.
Sourcepub fn as_ref(&self) -> BranchNodeRef<'_>
pub fn as_ref(&self) -> BranchNodeRef<'_>
Return branch node as BranchNodeRef.
Trait Implementations§
Source§impl Clone for BranchNode
impl Clone for BranchNode
Source§fn clone(&self) -> BranchNode
fn clone(&self) -> BranchNode
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 BranchNode
impl Debug for BranchNode
Source§impl Decodable for BranchNode
impl Decodable for BranchNode
Source§impl Default for BranchNode
impl Default for BranchNode
Source§fn default() -> BranchNode
fn default() -> BranchNode
Returns the “default value” for a type. Read more
Source§impl Encodable for BranchNode
impl Encodable for BranchNode
Source§impl PartialEq for BranchNode
impl PartialEq for BranchNode
impl Eq for BranchNode
impl StructuralPartialEq for BranchNode
Auto Trait Implementations§
impl Freeze for BranchNode
impl RefUnwindSafe for BranchNode
impl Send for BranchNode
impl Sync for BranchNode
impl Unpin for BranchNode
impl UnwindSafe for BranchNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.