reth_db::cursor

Trait DbDupCursorRO

pub trait DbDupCursorRO<T>
where T: DupSort,
{ // Required methods fn next_dup( &mut self, ) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>; fn next_no_dup( &mut self, ) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>; fn next_dup_val( &mut self, ) -> Result<Option<<T as Table>::Value>, DatabaseError>; fn seek_by_key_subkey( &mut self, key: <T as Table>::Key, subkey: <T as DupSort>::SubKey, ) -> Result<Option<<T as Table>::Value>, DatabaseError>; fn walk_dup( &mut self, key: Option<<T as Table>::Key>, subkey: Option<<T as DupSort>::SubKey>, ) -> Result<DupWalker<'_, T, Self>, DatabaseError> where Self: Sized; }
Expand description

A read-only cursor over the dup table T.

Required Methods§

fn next_dup( &mut self, ) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>

Positions the cursor at the next KV pair of the table, returning it.

fn next_no_dup( &mut self, ) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>

Positions the cursor at the next KV pair of the table, skipping duplicates.

fn next_dup_val(&mut self) -> Result<Option<<T as Table>::Value>, DatabaseError>

Positions the cursor at the next duplicate value of the current key.

fn seek_by_key_subkey( &mut self, key: <T as Table>::Key, subkey: <T as DupSort>::SubKey, ) -> Result<Option<<T as Table>::Value>, DatabaseError>

Positions the cursor at the entry greater than or equal to the provided key/subkey pair.

§Note

The position of the cursor might not correspond to the key/subkey pair if the entry does not exist.

fn walk_dup( &mut self, key: Option<<T as Table>::Key>, subkey: Option<<T as DupSort>::SubKey>, ) -> Result<DupWalker<'_, T, Self>, DatabaseError>
where Self: Sized,

Get an iterator that walks through the dup table.

The cursor will start at different points in the table depending on the values of key and subkey:

keysubkeyEquivalent starting position
NoneNoneDbCursorRO::first()
SomeNoneDbCursorRO::seek()
NoneSomeDbDupCursorRO::seek_by_key_subkey()
SomeSomeDbDupCursorRO::seek_by_key_subkey()

Implementors§

Source§

impl<K: TransactionKind, T: DupSort> DbDupCursorRO<T> for Cursor<K, T>

Available on crate feature mdbx only.
§

impl<T> DbDupCursorRO<T> for CursorMock
where T: DupSort,