Trait HashedCursor

pub trait HashedCursor {
    type Value: Debug;

    // Required methods
    fn seek(
        &mut self,
        key: FixedBytes<32>,
    ) -> Result<Option<(FixedBytes<32>, Self::Value)>, DatabaseError>;
    fn next(
        &mut self,
    ) -> Result<Option<(FixedBytes<32>, Self::Value)>, DatabaseError>;
}
Available on crate feature trie only.
Expand description

The cursor for iterating over hashed entries.

Required Associated Types§

type Value: Debug

Value returned by the cursor.

Required Methods§

fn seek( &mut self, key: FixedBytes<32>, ) -> Result<Option<(FixedBytes<32>, Self::Value)>, DatabaseError>

Seek an entry greater or equal to the given key and position the cursor there. Returns the first entry with the key greater or equal to the sought key.

fn next( &mut self, ) -> Result<Option<(FixedBytes<32>, Self::Value)>, DatabaseError>

Move the cursor to the next entry and return it.

Implementations on Foreign Types§

§

impl<C> HashedCursor for DatabaseHashedAccountCursor<C>

§

type Value = Account

§

fn seek( &mut self, key: FixedBytes<32>, ) -> Result<Option<(FixedBytes<32>, <DatabaseHashedAccountCursor<C> as HashedCursor>::Value)>, DatabaseError>

§

fn next( &mut self, ) -> Result<Option<(FixedBytes<32>, <DatabaseHashedAccountCursor<C> as HashedCursor>::Value)>, DatabaseError>

§

impl<C> HashedCursor for DatabaseHashedStorageCursor<C>

§

type Value = Uint<256, 4>

§

fn seek( &mut self, subkey: FixedBytes<32>, ) -> Result<Option<(FixedBytes<32>, <DatabaseHashedStorageCursor<C> as HashedCursor>::Value)>, DatabaseError>

§

fn next( &mut self, ) -> Result<Option<(FixedBytes<32>, <DatabaseHashedStorageCursor<C> as HashedCursor>::Value)>, DatabaseError>

Implementors§

§

impl HashedCursor for NoopHashedAccountCursor

§

impl HashedCursor for NoopHashedStorageCursor

§

type Value = Uint<256, 4>

§

impl<C> HashedCursor for HashedPostStateAccountCursor<'_, C>
where C: HashedCursor<Value = Account>,

§

impl<C> HashedCursor for HashedPostStateStorageCursor<'_, C>
where C: HashedStorageCursor<Value = Uint<256, 4>>,

§

type Value = Uint<256, 4>