Skip to main content

Cursor

Trait Cursor 

Source
pub trait Cursor {
    type Storage;
    type Key<'a>: Copy + Ord;
    type ValOwn: Clone + Ord;
    type Val<'a>: Copy + Ord;
    type Time: Lattice + Timestamp;
    type TimeGat<'a>: Copy + Ord;
    type Diff: Semigroup + 'static;
    type DiffGat<'a>: Copy + Ord;
    type KeyContainer: for<'a> BatchContainer<ReadItem<'a> = Self::Key<'a>>;
    type ValContainer: for<'a> BatchContainer<ReadItem<'a> = Self::Val<'a>, Owned = Self::ValOwn>;
    type TimeContainer: for<'a> BatchContainer<ReadItem<'a> = Self::TimeGat<'a>, Owned = Self::Time>;
    type DiffContainer: for<'a> BatchContainer<ReadItem<'a> = Self::DiffGat<'a>, Owned = Self::Diff>;

Show 19 methods // Required methods fn key_valid(&self, storage: &Self::Storage) -> bool; fn val_valid(&self, storage: &Self::Storage) -> bool; fn key<'a>(&self, storage: &'a Self::Storage) -> Self::Key<'a>; fn val<'a>(&self, storage: &'a Self::Storage) -> Self::Val<'a>; fn get_key<'a>(&self, storage: &'a Self::Storage) -> Option<Self::Key<'a>>; fn get_val<'a>(&self, storage: &'a Self::Storage) -> Option<Self::Val<'a>>; fn map_times<L: FnMut(Self::TimeGat<'_>, Self::DiffGat<'_>)>( &mut self, storage: &Self::Storage, logic: L, ); fn step_key(&mut self, storage: &Self::Storage); fn seek_key(&mut self, storage: &Self::Storage, key: Self::Key<'_>); fn step_val(&mut self, storage: &Self::Storage); fn seek_val(&mut self, storage: &Self::Storage, val: Self::Val<'_>); fn rewind_keys(&mut self, storage: &Self::Storage); fn rewind_vals(&mut self, storage: &Self::Storage); // Provided methods fn owned_val(val: Self::Val<'_>) -> Self::ValOwn { ... } fn owned_time(time: Self::TimeGat<'_>) -> Self::Time { ... } fn owned_diff(diff: Self::DiffGat<'_>) -> Self::Diff { ... } fn clone_time_onto(time: Self::TimeGat<'_>, onto: &mut Self::Time) { ... } fn populate_key<'a>( &mut self, storage: &'a Self::Storage, key: Self::Key<'a>, meet: Option<&Self::Time>, target: &mut EditList<Self::Val<'a>, Self::Time, Self::Diff>, ) { ... } fn to_vec<K, IK, V, IV>( &mut self, storage: &Self::Storage, into_key: IK, into_val: IV, ) -> Vec<((K, V), Vec<(Self::Time, Self::Diff)>)> where IK: for<'a> Fn(Self::Key<'a>) -> K, IV: for<'a> Fn(Self::Val<'a>) -> V { ... }
}
Expand description

A cursor for navigating ordered (key, val, time, diff) updates.

Required Associated Types§

Source

type Storage

Storage required by the cursor.

Source

type Key<'a>: Copy + Ord

Alias for a borrowed key.

Source

type ValOwn: Clone + Ord

Alias for an owned val.

Source

type Val<'a>: Copy + Ord

Alias for a borrowed val.

Source

type Time: Lattice + Timestamp

Alias for an owned time.

Source

type TimeGat<'a>: Copy + Ord

Alias for a borrowed time.

Source

type Diff: Semigroup + 'static

Alias for an owned diff.

Source

type DiffGat<'a>: Copy + Ord

Alias for a borrowed diff.

Source

type KeyContainer: for<'a> BatchContainer<ReadItem<'a> = Self::Key<'a>>

Container for update keys.

Source

type ValContainer: for<'a> BatchContainer<ReadItem<'a> = Self::Val<'a>, Owned = Self::ValOwn>

Container for update vals.

Source

type TimeContainer: for<'a> BatchContainer<ReadItem<'a> = Self::TimeGat<'a>, Owned = Self::Time>

Container for times.

Source

type DiffContainer: for<'a> BatchContainer<ReadItem<'a> = Self::DiffGat<'a>, Owned = Self::Diff>

Container for diffs.

Required Methods§

Source

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.

Source

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.

Source

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

A reference to the current key. Asserts if invalid.

Source

fn val<'a>(&self, storage: &'a Self::Storage) -> Self::Val<'a>

A reference to the current value. Asserts if invalid.

Source

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

Returns a reference to the current key, if valid.

Source

fn get_val<'a>(&self, storage: &'a Self::Storage) -> Option<Self::Val<'a>>

Returns a reference to the current value, if valid.

Source

fn map_times<L: FnMut(Self::TimeGat<'_>, Self::DiffGat<'_>)>( &mut self, storage: &Self::Storage, logic: L, )

Applies logic to each pair of time and difference. Intended for mutation of the closure’s scope.

Source

fn step_key(&mut self, storage: &Self::Storage)

Advances the cursor to the next key.

Source

fn seek_key(&mut self, storage: &Self::Storage, key: Self::Key<'_>)

Advances the cursor to the specified key.

Source

fn step_val(&mut self, storage: &Self::Storage)

Advances the cursor to the next value.

Source

fn seek_val(&mut self, storage: &Self::Storage, val: Self::Val<'_>)

Advances the cursor to the specified value.

Source

fn rewind_keys(&mut self, storage: &Self::Storage)

Rewinds the cursor to the first key.

Source

fn rewind_vals(&mut self, storage: &Self::Storage)

Rewinds the cursor to the first value for current key.

Provided Methods§

Source

fn owned_val(val: Self::Val<'_>) -> Self::ValOwn

Construct an owned val from a reference.

Source

fn owned_time(time: Self::TimeGat<'_>) -> Self::Time

Construct an owned time from a reference.

Source

fn owned_diff(diff: Self::DiffGat<'_>) -> Self::Diff

Construct an owned diff from a reference.

Source

fn clone_time_onto(time: Self::TimeGat<'_>, onto: &mut Self::Time)

Clones a reference time onto an owned time.

Source

fn populate_key<'a>( &mut self, storage: &'a Self::Storage, key: Self::Key<'a>, meet: Option<&Self::Time>, target: &mut EditList<Self::Val<'a>, Self::Time, Self::Diff>, )

Loads target with all updates associated with the supplied key.

First target is cleared, and then if we find key we populated it with each of its (val, time, diff) updates. If meet is supplied, the time is joined with each time in the updates, to advance the times before consolidation.

Source

fn to_vec<K, IK, V, IV>( &mut self, storage: &Self::Storage, into_key: IK, into_val: IV, ) -> Vec<((K, V), Vec<(Self::Time, Self::Diff)>)>
where IK: for<'a> Fn(Self::Key<'a>) -> K, IV: for<'a> Fn(Self::Val<'a>) -> V,

Rewinds the cursor and outputs its contents to a Vec

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<C: Cursor<Storage: BatchReader>> Cursor for BatchCursorFrontier<C>

Source§

impl<C: Cursor> Cursor for CursorList<C>

Source§

type Storage = Vec<<C as Cursor>::Storage>

Source§

type Key<'a> = <C as Cursor>::Key<'a>

Source§

type ValOwn = <C as Cursor>::ValOwn

Source§

type Val<'a> = <C as Cursor>::Val<'a>

Source§

type Time = <C as Cursor>::Time

Source§

type TimeGat<'a> = <C as Cursor>::TimeGat<'a>

Source§

type Diff = <C as Cursor>::Diff

Source§

type DiffGat<'a> = <C as Cursor>::DiffGat<'a>

Source§

type KeyContainer = <C as Cursor>::KeyContainer

Source§

type ValContainer = <C as Cursor>::ValContainer

Source§

type TimeContainer = <C as Cursor>::TimeContainer

Source§

type DiffContainer = <C as Cursor>::DiffContainer

Source§

impl<C: Cursor> Cursor for RcBatchCursor<C>

Source§

type Storage = Rc<<C as Cursor>::Storage>

Source§

type Key<'a> = <C as Cursor>::Key<'a>

Source§

type ValOwn = <C as Cursor>::ValOwn

Source§

type Val<'a> = <C as Cursor>::Val<'a>

Source§

type Time = <C as Cursor>::Time

Source§

type TimeGat<'a> = <C as Cursor>::TimeGat<'a>

Source§

type Diff = <C as Cursor>::Diff

Source§

type DiffGat<'a> = <C as Cursor>::DiffGat<'a>

Source§

type KeyContainer = <C as Cursor>::KeyContainer

Source§

type ValContainer = <C as Cursor>::ValContainer

Source§

type TimeContainer = <C as Cursor>::TimeContainer

Source§

type DiffContainer = <C as Cursor>::DiffContainer

Source§

impl<C: NavigableChunk> Cursor for ChunkBatchCursor<C>

Source§

impl<K, V, T, R> Cursor for VecChunkCursor<K, V, T, R>
where K: Ord + Clone + 'static, V: Ord + Clone + 'static, T: Lattice + Timestamp, R: Ord + Semigroup + 'static,

Source§

impl<L: Layout> Cursor for OrdValCursor<L>

Source§

impl<L: for<'a> Layout<ValContainer: BatchContainer<Owned: Default>>> Cursor for OrdKeyCursor<L>

Source§

impl<TInner, C: Cursor, F> Cursor for differential_dataflow::trace::wrappers::enter_at::BatchCursorEnter<C, TInner, F>
where TInner: Refines<C::Time> + Lattice, F: FnMut(C::Key<'_>, C::Val<'_>, C::TimeGat<'_>) -> TInner,

Source§

type Storage = BatchEnter<<C as Cursor>::Storage, TInner, F>

Source§

type Key<'a> = <C as Cursor>::Key<'a>

Source§

type ValOwn = <C as Cursor>::ValOwn

Source§

type Val<'a> = <C as Cursor>::Val<'a>

Source§

type KeyContainer = <C as Cursor>::KeyContainer

Source§

type ValContainer = <C as Cursor>::ValContainer

Source§

type DiffContainer = <C as Cursor>::DiffContainer

Source§

type Diff = <C as Cursor>::Diff

Source§

type DiffGat<'a> = <C as Cursor>::DiffGat<'a>

Source§

type TimeContainer = Vec<TInner>

Source§

type Time = <Vec<TInner> as BatchContainer>::Owned

Source§

type TimeGat<'a> = <Vec<TInner> as BatchContainer>::ReadItem<'a>

Source§

impl<TInner, C: Cursor> Cursor for differential_dataflow::trace::wrappers::enter::BatchCursorEnter<C, TInner>
where TInner: Refines<C::Time> + Lattice,

Source§

type Storage = BatchEnter<<C as Cursor>::Storage, TInner>

Source§

type Key<'a> = <C as Cursor>::Key<'a>

Source§

type ValOwn = <C as Cursor>::ValOwn

Source§

type Val<'a> = <C as Cursor>::Val<'a>

Source§

type KeyContainer = <C as Cursor>::KeyContainer

Source§

type ValContainer = <C as Cursor>::ValContainer

Source§

type DiffContainer = <C as Cursor>::DiffContainer

Source§

type Diff = <C as Cursor>::Diff

Source§

type DiffGat<'a> = <C as Cursor>::DiffGat<'a>

Source§

type TimeContainer = Vec<TInner>

Source§

type Time = <Vec<TInner> as BatchContainer>::Owned

Source§

type TimeGat<'a> = <Vec<TInner> as BatchContainer>::ReadItem<'a>

Source§

impl<U: ColumnarUpdate> Cursor for ColChunkCursor<U>