pub trait Cursor<'s> {
type Item<'k>
where Self: 'k;
type Key: ?Sized;
type ValueCursor: Cursor<'s>;
// Required methods
fn keys(&self) -> usize;
fn item(&self) -> Self::Item<'_>;
fn values(&self) -> Self::ValueCursor;
fn step(&mut self);
fn step_reverse(&mut self);
fn seek(&mut self, key: &Self::Key);
fn seek_reverse(&mut self, key: &Self::Key);
fn valid(&self) -> bool;
fn rewind(&mut self);
fn fast_forward(&mut self);
fn position(&self) -> usize;
fn reposition(&mut self, lower: usize, upper: usize);
}Expand description
A type supporting navigation.
The precise meaning of this navigation is not defined by the trait. It is
likely that having navigated around, the cursor will be different in some
other way, but the Cursor trait does not explain how this is so.
Required Associated Types§
type ValueCursor: Cursor<'s>
Required Methods§
fn keys(&self) -> usize
Sourcefn values(&self) -> Self::ValueCursor
fn values(&self) -> Self::ValueCursor
Returns cursor over values associted with the current key.
Sourcefn step_reverse(&mut self)
fn step_reverse(&mut self)
Move cursor back by one element.
Sourcefn seek(&mut self, key: &Self::Key)
fn seek(&mut self, key: &Self::Key)
Advances the cursor until the location where key would be expected.
Sourcefn seek_reverse(&mut self, key: &Self::Key)
fn seek_reverse(&mut self, key: &Self::Key)
Move the cursor back until the location where key would be expected.
Sourcefn valid(&self) -> bool
fn valid(&self) -> bool
Returns true if the cursor points at valid data. Returns false if
the cursor is exhausted.
Sourcefn fast_forward(&mut self)
fn fast_forward(&mut self)
Moves the cursor to the last position.
Sourcefn reposition(&mut self, lower: usize, upper: usize)
fn reposition(&mut self, lower: usize, upper: usize)
Repositions the cursor to a different range of values.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".