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§
Sourcefn next_dup(
&mut self,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
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.
Sourcefn next_no_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>
Positions the cursor at the next KV pair of the table, skipping duplicates.
Sourcefn next_dup_val(&mut self) -> Result<Option<<T as Table>::Value>, DatabaseError>
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.
Sourcefn seek_by_key_subkey(
&mut self,
key: <T as Table>::Key,
subkey: <T as DupSort>::SubKey,
) -> 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>
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.
Sourcefn walk_dup(
&mut self,
key: Option<<T as Table>::Key>,
subkey: Option<<T as DupSort>::SubKey>,
) -> Result<DupWalker<'_, T, Self>, DatabaseError>where
Self: Sized,
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
:
key | subkey | Equivalent starting position |
---|---|---|
None | None | DbCursorRO::first() |
Some | None | DbCursorRO::seek() |
None | Some | DbDupCursorRO::seek_by_key_subkey() |
Some | Some | DbDupCursorRO::seek_by_key_subkey() |
Implementors§
impl<K: TransactionKind, T: DupSort> DbDupCursorRO<T> for Cursor<K, T>
Available on crate feature
mdbx
only.