pub trait ReadCursor<'txn, T: Table>: Clone {
type IntoIter: Iterator<Item = Row<T>>;
// Required methods
fn first(&mut self) -> Option<Row<T>>;
fn last(&mut self) -> Option<Row<T>>;
fn next(&mut self) -> Option<Row<T>>;
fn prev(&mut self) -> Option<Row<T>>;
fn get_current(&mut self) -> Option<Row<T>>;
fn set_key(&mut self, key: &T::Key) -> Option<T::Value>;
fn set_lowerbound_key(&mut self, key: &T::Key) -> Option<Row<T>>;
fn into_iter_start(self) -> Self::IntoIter;
fn into_iter_from(self, key: &T::Key) -> Self::IntoIter;
}Expand description
A cursor is used for navigating the entries within a table. The read-only version cannot modify entries.
Closely follows libmdbx’s cursor API.
Required Associated Types§
Required Methods§
Sourcefn next(&mut self) -> Option<Row<T>>
fn next(&mut self) -> Option<Row<T>>
Positions the cursor at the next entry in the table.
For a DupTable, this can be either the next duplicate for the current key
or the first duplicate for the next key.
Sourcefn prev(&mut self) -> Option<Row<T>>
fn prev(&mut self) -> Option<Row<T>>
Positions the cursor at the previous entry in the table.
For a DupTable, this can be either the next duplicate for the current key
or the first duplicate for the next key.
Sourcefn get_current(&mut self) -> Option<Row<T>>
fn get_current(&mut self) -> Option<Row<T>>
Returns the current entry at the cursor position.
Sourcefn set_key(&mut self, key: &T::Key) -> Option<T::Value>
fn set_key(&mut self, key: &T::Key) -> Option<T::Value>
Positions the cursor at the entry that has a key == key.
Previously seek_key.
Sourcefn set_lowerbound_key(&mut self, key: &T::Key) -> Option<Row<T>>
fn set_lowerbound_key(&mut self, key: &T::Key) -> Option<Row<T>>
Positions the cursor at the first entry that has a key >= key.
Previously seek_range_key.
Sourcefn into_iter_start(self) -> Self::IntoIter
fn into_iter_start(self) -> Self::IntoIter
Iterates over all entries in the table.
Sourcefn into_iter_from(self, key: &T::Key) -> Self::IntoIter
fn into_iter_from(self, key: &T::Key) -> Self::IntoIter
Iterates over all entries in the table starting from a given key.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.