reth_db_api::cursor

Trait DbDupCursorRO

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

A read-only cursor over the dup table T.

Required Methods§

Source

fn next_dup(&mut self) -> PairResult<T>

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

Source

fn next_no_dup(&mut self) -> PairResult<T>

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

Source

fn next_dup_val(&mut self) -> ValueOnlyResult<T>

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

Source

fn seek_by_key_subkey( &mut self, key: T::Key, subkey: T::SubKey, ) -> ValueOnlyResult<T>

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.

Source

fn walk_dup( &mut self, key: Option<T::Key>, subkey: Option<T::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§