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§
Sourcefn next_dup(&mut self) -> PairResult<T>
fn next_dup(&mut self) -> PairResult<T>
Positions the cursor at the next KV pair of the table, returning it.
Sourcefn next_no_dup(&mut self) -> PairResult<T>
fn next_no_dup(&mut self) -> PairResult<T>
Positions the cursor at the next KV pair of the table, skipping duplicates.
Sourcefn next_dup_val(&mut self) -> ValueOnlyResult<T>
fn next_dup_val(&mut self) -> ValueOnlyResult<T>
Positions the cursor at the next duplicate value of the current key.
Sourcefn seek_by_key_subkey(
&mut self,
key: T::Key,
subkey: T::SubKey,
) -> ValueOnlyResult<T>
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.
Sourcefn walk_dup(
&mut self,
key: Option<T::Key>,
subkey: Option<T::SubKey>,
) -> Result<DupWalker<'_, T, Self>, DatabaseError>where
Self: Sized,
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
:
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() |