pub trait Cursor<Storage> {
    type Key;

    // Required methods
    fn key<'a>(&self, storage: &'a Storage) -> &'a Self::Key;
    fn step(&mut self, storage: &Storage);
    fn seek(&mut self, storage: &Storage, key: &Self::Key);
    fn valid(&self, storage: &Storage) -> bool;
    fn rewind(&mut self, storage: &Storage);
    fn reposition(&mut self, storage: &Storage, 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§

source

type Key

The type revealed by the cursor.

Required Methods§

source

fn key<'a>(&self, storage: &'a Storage) -> &'a Self::Key

Reveals the current key.

source

fn step(&mut self, storage: &Storage)

Advances the cursor by one element.

source

fn seek(&mut self, storage: &Storage, key: &Self::Key)

Advances the cursor until the location where key would be expected.

source

fn valid(&self, storage: &Storage) -> bool

Returns true if the cursor points at valid data. Returns false if the cursor is exhausted.

source

fn rewind(&mut self, storage: &Storage)

Rewinds the cursor to its initial state.

source

fn reposition(&mut self, storage: &Storage, lower: usize, upper: usize)

Repositions the cursor to a different range of values.

Implementors§

source§

impl<K, L, O, C> Cursor<OrderedLayer<K, L, O, C>> for OrderedCursor<L>where K: Ord, C: BatchContainer<Item = K>, L: Trie, O: OrdOffset,

§

type Key = K

source§

impl<K: Clone, R: Clone, C> Cursor<OrderedLeaf<K, R, C>> for OrderedLeafCursorwhere C: BatchContainer<Item = (K, R)> + Deref<Target = [(K, R)]>,

§

type Key = (K, R)