Trait Cursor

Source
pub trait Cursor {
    type Key<'a>: Copy + Clone + MyTrait<'a, Owned = Self::KeyOwned>;
    type KeyOwned: Ord + Clone;
    type Val<'a>: Copy + Clone + MyTrait<'a, Owned = Self::ValOwned> + for<'b> PartialOrd<Self::Val<'b>>;
    type ValOwned: Ord + Clone;
    type Time;
    type Diff: ?Sized;
    type Storage;

Show 15 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 map_times<L: FnMut(&Self::Time, &Self::Diff)>( &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 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 seek_key_owned(&mut self, storage: &Self::Storage, key: &Self::KeyOwned) { ... } fn to_vec( &mut self, storage: &Self::Storage, ) -> Vec<((Self::KeyOwned, Self::ValOwned), Vec<(Self::Time, Self::Diff)>)> where Self::Time: Clone, Self::Diff: Clone { ... }
}
Expand description

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

Required Associated Types§

Source

type Key<'a>: Copy + Clone + MyTrait<'a, Owned = Self::KeyOwned>

Key by which updates are indexed.

Source

type KeyOwned: Ord + Clone

Owned version of the above.

Source

type Val<'a>: Copy + Clone + MyTrait<'a, Owned = Self::ValOwned> + for<'b> PartialOrd<Self::Val<'b>>

Values associated with keys.

Source

type ValOwned: Ord + Clone

Owned version of the above.

Source

type Time

Timestamps associated with updates

Source

type Diff: ?Sized

Associated update.

Source

type Storage

Storage required by the cursor.

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 map_times<L: FnMut(&Self::Time, &Self::Diff)>( &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 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 seek_key_owned(&mut self, storage: &Self::Storage, key: &Self::KeyOwned)

Convenience method to get access by reference to an owned key.

Source

fn to_vec( &mut self, storage: &Self::Storage, ) -> Vec<((Self::KeyOwned, Self::ValOwned), Vec<(Self::Time, Self::Diff)>)>
where Self::Time: Clone, Self::Diff: Clone,

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", so this trait is not object safe.

Implementors§

Source§

impl<C, F> Cursor for CursorFilter<C, F>
where C: Cursor, C::Time: Timestamp, F: FnMut(C::Key<'_>, C::Val<'_>) -> bool + 'static,

Source§

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

Source§

type KeyOwned = <C as Cursor>::KeyOwned

Source§

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

Source§

type ValOwned = <C as Cursor>::ValOwned

Source§

type Time = <C as Cursor>::Time

Source§

type Diff = <C as Cursor>::Diff

Source§

type Storage = <C as Cursor>::Storage

Source§

impl<C, F> Cursor for CursorFreeze<C, F>
where C: Cursor, C::Time: Sized, F: Fn(&C::Time) -> Option<C::Time>,

Source§

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

Source§

type KeyOwned = <C as Cursor>::KeyOwned

Source§

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

Source§

type ValOwned = <C as Cursor>::ValOwned

Source§

type Time = <C as Cursor>::Time

Source§

type Diff = <C as Cursor>::Diff

Source§

type Storage = <C as Cursor>::Storage

Source§

impl<C, T> Cursor for CursorFrontier<C, T>
where C: Cursor<Time = T>, T: Timestamp + Lattice,

Source§

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

Source§

type KeyOwned = <C as Cursor>::KeyOwned

Source§

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

Source§

type ValOwned = <C as Cursor>::ValOwned

Source§

type Time = <C as Cursor>::Time

Source§

type Diff = <C as Cursor>::Diff

Source§

type Storage = <C as Cursor>::Storage

Source§

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

Source§

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

Source§

type KeyOwned = <C as Cursor>::KeyOwned

Source§

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

Source§

type ValOwned = <C as Cursor>::ValOwned

Source§

type Time = TInner

Source§

type Diff = <C as Cursor>::Diff

Source§

type Storage = <C as Cursor>::Storage

Source§

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

Source§

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

Source§

type KeyOwned = <C as Cursor>::KeyOwned

Source§

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

Source§

type ValOwned = <C as Cursor>::ValOwned

Source§

type Time = TInner

Source§

type Diff = <C as Cursor>::Diff

Source§

type Storage = <C as Cursor>::Storage

Source§

impl<C: Cursor> Cursor for AbomonatedBatchCursor<C>
where C::Storage: Abomonation,

Source§

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

Source§

type KeyOwned = <C as Cursor>::KeyOwned

Source§

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

Source§

type ValOwned = <C as Cursor>::ValOwned

Source§

type Time = <C as Cursor>::Time

Source§

type Diff = <C as Cursor>::Diff

Source§

type Storage = Abomonated<<C as Cursor>::Storage, Vec<u8>>

Source§

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

Source§

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

Source§

type KeyOwned = <C as Cursor>::KeyOwned

Source§

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

Source§

type ValOwned = <C as Cursor>::ValOwned

Source§

type Time = <C as Cursor>::Time

Source§

type Diff = <C as Cursor>::Diff

Source§

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

Source§

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

Source§

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

Source§

type KeyOwned = <C as Cursor>::KeyOwned

Source§

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

Source§

type ValOwned = <C as Cursor>::ValOwned

Source§

type Time = <C as Cursor>::Time

Source§

type Diff = <C as Cursor>::Diff

Source§

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

Source§

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

Source§

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

Source§

type KeyOwned = <C as Cursor>::KeyOwned

Source§

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

Source§

type ValOwned = <C as Cursor>::ValOwned

Source§

type Time = <C as Cursor>::Time

Source§

type Diff = <C as Cursor>::Diff

Source§

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

Source§

impl<C: Cursor, F> Cursor for BatchCursorFilter<C, F>
where C::Time: Timestamp, F: FnMut(C::Key<'_>, C::Val<'_>) -> bool + 'static,

Source§

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

Source§

type KeyOwned = <C as Cursor>::KeyOwned

Source§

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

Source§

type ValOwned = <C as Cursor>::ValOwned

Source§

type Time = <C as Cursor>::Time

Source§

type Diff = <C as Cursor>::Diff

Source§

type Storage = BatchFilter<<C as Cursor>::Storage, F>

Source§

impl<C: Cursor, F> Cursor for BatchCursorFreeze<C, F>
where F: Fn(&C::Time) -> Option<C::Time>,

Source§

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

Source§

type KeyOwned = <C as Cursor>::KeyOwned

Source§

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

Source§

type ValOwned = <C as Cursor>::ValOwned

Source§

type Time = <C as Cursor>::Time

Source§

type Diff = <C as Cursor>::Diff

Source§

type Storage = BatchFreeze<<C as Cursor>::Storage, F>

Source§

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

Source§

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

Source§

type KeyOwned = <C as Cursor>::KeyOwned

Source§

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

Source§

type ValOwned = <C as Cursor>::ValOwned

Source§

type Time = TInner

Source§

type Diff = <C as Cursor>::Diff

Source§

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

Source§

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

Source§

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

Source§

type KeyOwned = <C as Cursor>::KeyOwned

Source§

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

Source§

type ValOwned = <C as Cursor>::ValOwned

Source§

type Time = TInner

Source§

type Diff = <C as Cursor>::Diff

Source§

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