Trait differential_dataflow::trace::cursor::Cursor
[−]
[src]
pub trait Cursor<K, V, T, R> { type Storage; fn key_valid(&self, storage: &Self::Storage) -> bool; fn val_valid(&self, storage: &Self::Storage) -> bool; fn key<'a>(&self, storage: &'a Self::Storage) -> &'a K; fn val<'a>(&self, storage: &'a Self::Storage) -> &'a V; fn map_times<L: FnMut(&T, R)>(&mut self, storage: &Self::Storage, logic: L); fn step_key(&mut self, storage: &Self::Storage); fn seek_key(&mut self, storage: &Self::Storage, key: &K); fn step_val(&mut self, storage: &Self::Storage); fn seek_val(&mut self, storage: &Self::Storage, val: &V); fn rewind_keys(&mut self, storage: &Self::Storage); fn rewind_vals(&mut self, storage: &Self::Storage); fn get_key<'a>(&self, storage: &'a Self::Storage) -> Option<&'a K> { ... } fn get_val<'a>(&self, storage: &'a Self::Storage) -> Option<&'a V> { ... } }
A cursor for navigating ordered (key, val, time, diff)
updates.
Associated Types
type Storage
Type the cursor addresses data in.
Required Methods
fn key_valid(&self, storage: &Self::Storage) -> bool
Indicates if the current key is valid.
A value of false
indicates that the cursor has exhausted all keys.
fn val_valid(&self, storage: &Self::Storage) -> bool
Indicates if the current value is valid.
A value of false
indicates that the cursor has exhausted all values for this key.
fn key<'a>(&self, storage: &'a Self::Storage) -> &'a K
A reference to the current key. Asserts if invalid.
fn val<'a>(&self, storage: &'a Self::Storage) -> &'a V
A reference to the current value. Asserts if invalid.
fn map_times<L: FnMut(&T, R)>(&mut self, storage: &Self::Storage, logic: L)
Applies logic
to each pair of time and difference. Intended for mutation of the
closure's scope.
fn step_key(&mut self, storage: &Self::Storage)
Advances the cursor to the next key. Indicates if the key is valid.
fn seek_key(&mut self, storage: &Self::Storage, key: &K)
Advances the cursor to the specified key. Indicates if the key is valid.
fn step_val(&mut self, storage: &Self::Storage)
Advances the cursor to the next value. Indicates if the value is valid.
fn seek_val(&mut self, storage: &Self::Storage, val: &V)
Advances the cursor to the specified value. Indicates if the value is valid.
fn rewind_keys(&mut self, storage: &Self::Storage)
Rewinds the cursor to the first key.
fn rewind_vals(&mut self, storage: &Self::Storage)
Rewinds the cursor to the first value for current key.
Provided Methods
fn get_key<'a>(&self, storage: &'a Self::Storage) -> Option<&'a K>
Returns a reference to the current key, if valid.
fn get_val<'a>(&self, storage: &'a Self::Storage) -> Option<&'a V>
Returns a reference to the current value, if valid.
Implementors
impl<K, V, T, R, C: Cursor<K, V, T, R>> Cursor<K, V, T, R> for CursorList<K, V, T, R, C> where
K: Ord,
V: Ord, type Storage = Vec<C::Storage>;impl<K, V, T, R, C1, C2> Cursor<K, V, T, R> for CursorPair<C1, C2> where
K: Ord,
V: Ord,
C1: Cursor<K, V, T, R>,
C2: Cursor<K, V, T, R>, type Storage = (C1::Storage, C2::Storage);impl<K, V, T, R> Cursor<K, V, T, R> for OrdValCursor<V, T, R> where
K: Ord + Clone,
V: Ord + Clone,
T: Lattice + Ord + Clone,
R: Diff, type Storage = OrdValBatch<K, V, T, R>;impl<K: Ord + Clone, T: Lattice + Ord + Clone, R: Diff> Cursor<K, (), T, R> for OrdKeyCursor<T, R> type Storage = OrdKeyBatch<K, T, R>;
impl<K, V, T, R, C, TInner> Cursor<K, V, Product<T, TInner>, R> for CursorEnter<K, V, T, R, C, TInner> where
C: Cursor<K, V, T, R>,
T: Clone, type Storage = C::Storage;impl<K, V, T, R, TInner, B: BatchReader<K, V, T, R>> Cursor<K, V, Product<T, TInner>, R> for BatchCursorEnter<K, V, T, R, B, TInner> where
T: Clone, type Storage = BatchEnter<K, V, T, R, B, TInner>;impl<K, V, T, R, C, F> Cursor<K, V, T, R> for CursorFreeze<K, V, T, R, C, F> where
C: Cursor<K, V, T, R>,
F: Fn(&T) -> Option<T>, type Storage = C::Storage;impl<K, V, T, R, B: BatchReader<K, V, T, R>, F> Cursor<K, V, T, R> for BatchCursorFreeze<K, V, T, R, B, F> where
F: Fn(&T) -> Option<T>, type Storage = BatchFreeze<K, V, T, R, B, F>;impl<K, V, T, R, B: BatchReader<K, V, T, R>> Cursor<K, V, T, R> for RcBatchCursor<K, V, T, R, B> type Storage = Rc<B>;
impl<K, V, T, R, B: BatchReader<K, V, T, R> + Abomonation> Cursor<K, V, T, R> for AbomonatedBatchCursor<K, V, T, R, B> type Storage = Abomonated<B, Vec<u8>>;