pub struct TrieNodeIter<C, H: HashedCursor, K> {
pub walker: TrieWalker<C, K>,
pub hashed_cursor: H,
/* private fields */
}Expand description
Iterates over trie nodes for hash building.
This iterator depends on the ordering guarantees of TrieCursor,
and additionally uses hashed cursor lookups when operating on storage tries.
Fields§
§walker: TrieWalker<C, K>The walker over intermediate nodes.
hashed_cursor: HThe cursor for the hashed entries.
Implementations§
Source§impl<C, H: HashedCursor, K> TrieNodeIter<C, H, K>
impl<C, H: HashedCursor, K> TrieNodeIter<C, H, K>
Sourcepub fn state_trie(walker: TrieWalker<C, K>, hashed_cursor: H) -> Self
pub fn state_trie(walker: TrieWalker<C, K>, hashed_cursor: H) -> Self
Creates a new TrieNodeIter for the state trie.
Sourcepub fn storage_trie(walker: TrieWalker<C, K>, hashed_cursor: H) -> Self
pub fn storage_trie(walker: TrieWalker<C, K>, hashed_cursor: H) -> Self
Creates a new TrieNodeIter for the storage trie.
Sourcepub const fn with_last_hashed_key(self, previous_hashed_key: B256) -> Self
pub const fn with_last_hashed_key(self, previous_hashed_key: B256) -> Self
Sets the last iterated hashed key and returns the modified TrieNodeIter.
This is used to resume iteration from the last checkpoint.
Source§impl<C, H, K> TrieNodeIter<C, H, K>
impl<C, H, K> TrieNodeIter<C, H, K>
Sourcepub fn try_next(
&mut self,
) -> Result<Option<TrieElement<<H as HashedCursor>::Value>>, DatabaseError>
pub fn try_next( &mut self, ) -> Result<Option<TrieElement<<H as HashedCursor>::Value>>, DatabaseError>
Return the next trie node to be added to the hash builder.
Returns the nodes using this algorithm:
- Return the current intermediate branch node if it hasn’t been updated.
- Advance the trie walker to the next intermediate branch node and retrieve next unprocessed key.
- Reposition the hashed cursor on the next unprocessed key.
- Return every hashed entry up to the key of the current intermediate branch node.
- Repeat.
NOTE: The iteration will start from the key of the previous hashed entry if it was supplied.
Trait Implementations§
Auto Trait Implementations§
impl<C, H, K> !RefUnwindSafe for TrieNodeIter<C, H, K>
impl<C, H, K> !UnwindSafe for TrieNodeIter<C, H, K>
impl<C, H, K> Freeze for TrieNodeIter<C, H, K>where
TrieWalker<C, K>: Freeze,
H: Freeze,
Option<(FixedBytes<32>, <H as HashedCursor>::Value)>: Freeze,
Option<SeekedHashedEntry<<H as HashedCursor>::Value>>: Freeze,
impl<C, H, K> Send for TrieNodeIter<C, H, K>where
TrieWalker<C, K>: Send,
H: Send,
Option<(FixedBytes<32>, <H as HashedCursor>::Value)>: Send,
Option<SeekedHashedEntry<<H as HashedCursor>::Value>>: Send,
impl<C, H, K> Sync for TrieNodeIter<C, H, K>where
TrieWalker<C, K>: Sync,
H: Sync,
Option<(FixedBytes<32>, <H as HashedCursor>::Value)>: Sync,
Option<SeekedHashedEntry<<H as HashedCursor>::Value>>: Sync,
impl<C, H, K> Unpin for TrieNodeIter<C, H, K>where
TrieWalker<C, K>: Unpin,
H: Unpin,
Option<(FixedBytes<32>, <H as HashedCursor>::Value)>: Unpin,
Option<SeekedHashedEntry<<H as HashedCursor>::Value>>: Unpin,
impl<C, H, K> UnsafeUnpin for TrieNodeIter<C, H, K>where
TrieWalker<C, K>: UnsafeUnpin,
H: UnsafeUnpin,
Option<(FixedBytes<32>, <H as HashedCursor>::Value)>: UnsafeUnpin,
Option<SeekedHashedEntry<<H as HashedCursor>::Value>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeDebug for Twhere
T: Debug,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.