pub struct HashedPostStateCursor<'a, C, V>where
V: HashedPostStateCursorValue,{ /* private fields */ }Expand description
A cursor to iterate over state updates and corresponding database entries. It will always give precedence to the data from the post state updates.
Implementations§
Source§impl<'a, C> HashedPostStateCursor<'a, C, Option<Account>>where
C: HashedCursor<Value = Account>,
impl<'a, C> HashedPostStateCursor<'a, C, Option<Account>>where
C: HashedCursor<Value = Account>,
Sourcepub fn new_account(cursor: C, post_state: &'a HashedPostStateSorted) -> Self
pub fn new_account(cursor: C, post_state: &'a HashedPostStateSorted) -> Self
Create new account cursor which combines a DB cursor and the post state.
Source§impl<'a, C> HashedPostStateCursor<'a, C, U256>where
C: HashedStorageCursor<Value = U256>,
impl<'a, C> HashedPostStateCursor<'a, C, U256>where
C: HashedStorageCursor<Value = U256>,
Sourcepub fn new_storage(
cursor: C,
post_state: &'a HashedPostStateSorted,
hashed_address: B256,
) -> Self
pub fn new_storage( cursor: C, post_state: &'a HashedPostStateSorted, hashed_address: B256, ) -> Self
Create new storage cursor with full post state reference.
This allows the cursor to switch between storage tries when set_hashed_address is called.
Trait Implementations§
Source§impl<'a, C: Debug, V> Debug for HashedPostStateCursor<'a, C, V>
impl<'a, C: Debug, V> Debug for HashedPostStateCursor<'a, C, V>
Source§impl<C, V> HashedCursor for HashedPostStateCursor<'_, C, V>
impl<C, V> HashedCursor for HashedPostStateCursor<'_, C, V>
Source§fn seek(
&mut self,
key: B256,
) -> Result<Option<(B256, Self::Value)>, DatabaseError>
fn seek( &mut self, key: B256, ) -> Result<Option<(B256, Self::Value)>, DatabaseError>
Seek the next entry for a given hashed key.
If the post state contains the exact match for the key, return it. Otherwise, retrieve the next entries that are greater than or equal to the key from the database and the post state. The two entries are compared and the lowest is returned.
The returned account key is memoized and the cursor remains positioned at that key until
HashedCursor::seek or HashedCursor::next are called.
Source§fn next(&mut self) -> Result<Option<(B256, Self::Value)>, DatabaseError>
fn next(&mut self) -> Result<Option<(B256, Self::Value)>, DatabaseError>
Retrieve the next entry from the cursor.
If the cursor is positioned at the entry, return the entry with next greater key. Returns None if the previous memoized or the next greater entries are missing.
NOTE: This function will not return any entry unless HashedCursor::seek has been called.
Source§type Value = <V as HashedPostStateCursorValue>::NonZero
type Value = <V as HashedPostStateCursorValue>::NonZero
Source§impl<C> HashedStorageCursor for HashedPostStateCursor<'_, C, U256>where
C: HashedStorageCursor<Value = U256>,
The cursor to iterate over post state hashed values and corresponding database entries.
It will always give precedence to the data from the post state.
impl<C> HashedStorageCursor for HashedPostStateCursor<'_, C, U256>where
C: HashedStorageCursor<Value = U256>,
The cursor to iterate over post state hashed values and corresponding database entries. It will always give precedence to the data from the post state.
Source§fn is_storage_empty(&mut self) -> Result<bool, DatabaseError>
fn is_storage_empty(&mut self) -> Result<bool, DatabaseError>
Returns true if the account has no storage entries.
This function should be called before attempting to call HashedCursor::seek or
HashedCursor::next.
Source§fn set_hashed_address(&mut self, hashed_address: B256)
fn set_hashed_address(&mut self, hashed_address: B256)
Auto Trait Implementations§
impl<'a, C, V> Freeze for HashedPostStateCursor<'a, C, V>where
C: Freeze,
DbCursorState<<V as HashedPostStateCursorValue>::NonZero>: Freeze,
ForwardInMemoryCursor<'a, FixedBytes<32>, V>: Freeze,
impl<'a, C, V> RefUnwindSafe for HashedPostStateCursor<'a, C, V>where
C: RefUnwindSafe,
DbCursorState<<V as HashedPostStateCursorValue>::NonZero>: RefUnwindSafe,
ForwardInMemoryCursor<'a, FixedBytes<32>, V>: RefUnwindSafe,
impl<'a, C, V> Send for HashedPostStateCursor<'a, C, V>where
C: Send,
DbCursorState<<V as HashedPostStateCursorValue>::NonZero>: Send,
ForwardInMemoryCursor<'a, FixedBytes<32>, V>: Send,
impl<'a, C, V> Sync for HashedPostStateCursor<'a, C, V>where
C: Sync,
DbCursorState<<V as HashedPostStateCursorValue>::NonZero>: Sync,
ForwardInMemoryCursor<'a, FixedBytes<32>, V>: Sync,
impl<'a, C, V> Unpin for HashedPostStateCursor<'a, C, V>where
C: Unpin,
DbCursorState<<V as HashedPostStateCursorValue>::NonZero>: Unpin,
ForwardInMemoryCursor<'a, FixedBytes<32>, V>: Unpin,
impl<'a, C, V> UnsafeUnpin for HashedPostStateCursor<'a, C, V>where
C: UnsafeUnpin,
DbCursorState<<V as HashedPostStateCursorValue>::NonZero>: UnsafeUnpin,
ForwardInMemoryCursor<'a, FixedBytes<32>, V>: UnsafeUnpin,
impl<'a, C, V> UnwindSafe for HashedPostStateCursor<'a, C, V>where
C: UnwindSafe,
DbCursorState<<V as HashedPostStateCursorValue>::NonZero>: UnwindSafe,
ForwardInMemoryCursor<'a, FixedBytes<32>, V>: UnwindSafe,
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.