HashedCursor

Trait HashedCursor 

Source
pub trait HashedCursor {
    type Value: Debug;

    // Required methods
    fn seek(
        &mut self,
        key: B256,
    ) -> Result<Option<(B256, Self::Value)>, DatabaseError>;
    fn next(&mut self) -> Result<Option<(B256, Self::Value)>, DatabaseError>;
    fn reset(&mut self);
}
Expand description

The cursor for iterating over hashed entries.

Required Associated Types§

Source

type Value: Debug

Value returned by the cursor.

Required Methods§

Source

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

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

Source

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

Move the cursor to the next entry and return it.

Source

fn reset(&mut self)

Reset the cursor to its initial state.

§Important

After calling this method, the subsequent operation MUST be a HashedCursor::seek call.

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + HashedCursor + ?Sized> HashedCursor for &'a mut T

Source§

type Value = <T as HashedCursor>::Value

Source§

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

Source§

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

Source§

fn reset(&mut self)

Implementors§