pub trait DbCursorRO<T>where
T: Table,{
// Required methods
fn first(
&mut self,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>;
fn seek_exact(
&mut self,
key: <T as Table>::Key,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>;
fn seek(
&mut self,
key: <T as Table>::Key,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>;
fn next(
&mut self,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>;
fn prev(
&mut self,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>;
fn last(
&mut self,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>;
fn current(
&mut self,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>;
fn walk(
&mut self,
start_key: Option<<T as Table>::Key>,
) -> Result<Walker<'_, T, Self>, DatabaseError>
where Self: Sized;
fn walk_range(
&mut self,
range: impl RangeBounds<<T as Table>::Key>,
) -> Result<RangeWalker<'_, T, Self>, DatabaseError>
where Self: Sized;
fn walk_back(
&mut self,
start_key: Option<<T as Table>::Key>,
) -> Result<ReverseWalker<'_, T, Self>, DatabaseError>
where Self: Sized;
}
Expand description
A read-only cursor over table T
.
Required Methods§
Sourcefn first(
&mut self,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
fn first( &mut self, ) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
Positions the cursor at the first entry in the table, returning it.
Sourcefn seek_exact(
&mut self,
key: <T as Table>::Key,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
fn seek_exact( &mut self, key: <T as Table>::Key, ) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
Seeks to the KV pair exactly at key
.
Sourcefn seek(
&mut self,
key: <T as Table>::Key,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
fn seek( &mut self, key: <T as Table>::Key, ) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
Seeks to the KV pair whose key is greater than or equal to key
.
Sourcefn next(
&mut self,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
fn next( &mut self, ) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
Position the cursor at the next KV pair, returning it.
Sourcefn prev(
&mut self,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
fn prev( &mut self, ) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
Position the cursor at the previous KV pair, returning it.
Sourcefn last(
&mut self,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
fn last( &mut self, ) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
Positions the cursor at the last entry in the table, returning it.
Sourcefn current(
&mut self,
) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
fn current( &mut self, ) -> Result<Option<(<T as Table>::Key, <T as Table>::Value)>, DatabaseError>
Get the KV pair at the cursor’s current position.
Sourcefn walk(
&mut self,
start_key: Option<<T as Table>::Key>,
) -> Result<Walker<'_, T, Self>, DatabaseError>where
Self: Sized,
fn walk(
&mut self,
start_key: Option<<T as Table>::Key>,
) -> Result<Walker<'_, T, Self>, DatabaseError>where
Self: Sized,
Get an iterator that walks through the table.
If start_key
is None
, then the walker will start from the first entry of the table,
otherwise it starts at the entry greater than or equal to the provided key.
Sourcefn walk_range(
&mut self,
range: impl RangeBounds<<T as Table>::Key>,
) -> Result<RangeWalker<'_, T, Self>, DatabaseError>where
Self: Sized,
fn walk_range(
&mut self,
range: impl RangeBounds<<T as Table>::Key>,
) -> Result<RangeWalker<'_, T, Self>, DatabaseError>where
Self: Sized,
Get an iterator that walks over a range of keys in the table.
Sourcefn walk_back(
&mut self,
start_key: Option<<T as Table>::Key>,
) -> Result<ReverseWalker<'_, T, Self>, DatabaseError>where
Self: Sized,
fn walk_back(
&mut self,
start_key: Option<<T as Table>::Key>,
) -> Result<ReverseWalker<'_, T, Self>, DatabaseError>where
Self: Sized,
Get an iterator that walks through the table in reverse order.
If start_key
is None
, then the walker will start from the last entry of the table,
otherwise it starts at the entry greater than or equal to the provided key.
Implementors§
impl<K: TransactionKind, T: Table> DbCursorRO<T> for Cursor<K, T>
mdbx
only.