Trait differential_dataflow::trace::cursor::Cursor
source · pub trait Cursor {
type Key<'a>: Copy + Clone + Ord;
type Val<'a>: Copy + Clone + Ord;
type Time: Timestamp + Lattice + Ord + Clone;
type TimeGat<'a>: Copy + IntoOwned<'a, Owned = Self::Time>;
type Diff: Semigroup + 'static;
type DiffGat<'a>: Copy + IntoOwned<'a, Owned = Self::Diff>;
type Storage;
Show 14 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::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 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 to_vec<K, V>(
&mut self,
storage: &Self::Storage,
) -> Vec<((K, V), Vec<(Self::Time, Self::Diff)>)>
where for<'a> Self::Key<'a>: IntoOwned<'a, Owned = K>,
for<'a> Self::Val<'a>: IntoOwned<'a, Owned = V> { ... }
}
Expand description
A cursor for navigating ordered (key, val, time, diff)
updates.
Required Associated Types§
Required Methods§
sourcefn key_valid(&self, storage: &Self::Storage) -> bool
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.
sourcefn val_valid(&self, storage: &Self::Storage) -> bool
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.
sourcefn key<'a>(&self, storage: &'a Self::Storage) -> Self::Key<'a>
fn key<'a>(&self, storage: &'a Self::Storage) -> Self::Key<'a>
A reference to the current key. Asserts if invalid.
sourcefn val<'a>(&self, storage: &'a Self::Storage) -> Self::Val<'a>
fn val<'a>(&self, storage: &'a Self::Storage) -> Self::Val<'a>
A reference to the current value. Asserts if invalid.
sourcefn map_times<L: FnMut(Self::TimeGat<'_>, Self::DiffGat<'_>)>(
&mut self,
storage: &Self::Storage,
logic: L,
)
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.
sourcefn seek_key(&mut self, storage: &Self::Storage, key: Self::Key<'_>)
fn seek_key(&mut self, storage: &Self::Storage, key: Self::Key<'_>)
Advances the cursor to the specified key.
sourcefn seek_val(&mut self, storage: &Self::Storage, val: Self::Val<'_>)
fn seek_val(&mut self, storage: &Self::Storage, val: Self::Val<'_>)
Advances the cursor to the specified value.
sourcefn rewind_keys(&mut self, storage: &Self::Storage)
fn rewind_keys(&mut self, storage: &Self::Storage)
Rewinds the cursor to the first key.
sourcefn rewind_vals(&mut self, storage: &Self::Storage)
fn rewind_vals(&mut self, storage: &Self::Storage)
Rewinds the cursor to the first value for current key.
Provided Methods§
sourcefn get_key<'a>(&self, storage: &'a Self::Storage) -> Option<Self::Key<'a>>
fn get_key<'a>(&self, storage: &'a Self::Storage) -> Option<Self::Key<'a>>
Returns a reference to the current key, if valid.
Object Safety§
This trait is not object safe.