Trait Seekable

Source
pub trait Seekable<Key: ?Sized, Cmp: ?Sized + Comparator<Key>> {
    // Required methods
    fn reset(&mut self);
    fn seek<K>(&mut self, min_bound: K)
       where Key: Borrow<K>;
    fn seek_before<K>(&mut self, strict_upper_bound: K)
       where Key: Borrow<K>;
    fn seek_to_first(&mut self);
    fn seek_to_last(&mut self);
}
Expand description

A trait adding seek functionality to one of the cursor iterator traits.

See CursorIterator, CursorLendingIterator, or CursorPooledIterator for more.

Required Methods§

Source

fn reset(&mut self)

Reset the iterator to its initial position, before the first entry and after the last entry (if there are any entries in the collection).

The iterator will then not be !valid().

Source

fn seek<K>(&mut self, min_bound: K)
where Key: Borrow<K>,

Move the iterator to the smallest key which is greater or equal than the provided min_bound.

If there is no such key, the iterator becomes !valid(), and is conceptually one position before the first entry and one position after the last entry (if there are any entries in the collection).

Source

fn seek_before<K>(&mut self, strict_upper_bound: K)
where Key: Borrow<K>,

Move the iterator to the greatest key which is strictly less than the provided strict_upper_bound.

If there is no such key, the iterator becomes !valid(), and is conceptually one position before the first entry and one position after the last entry (if there are any entries in the collection).

Source

fn seek_to_first(&mut self)

Move the iterator to the smallest key in the collection.

If the collection is empty, the iterator is !valid().

Source

fn seek_to_last(&mut self)

Move the iterator to the greatest key in the collection.

If the collection is empty, the iterator is !valid().

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.

Implementors§