pub struct UpdatesTyped<U: Update> {
pub keys: Lists<ContainerOf<U::Key>>,
pub vals: Lists<ContainerOf<U::Val>>,
pub times: Lists<ContainerOf<U::Time>>,
pub diffs: Lists<ContainerOf<U::Diff>>,
}Expand description
Trie-structured update storage using columnar containers.
Four nested layers of Lists:
keys: lists of keys (outer lists are independent groups)vals: per-key, lists of valstimes: per-val, lists of timesdiffs: per-time, lists of diffs (singletons when consolidated)
A flat unsorted input has stride 1 at every level (one key per entry, one val per key, one time per val, one diff per time). A fully consolidated trie has a single outer key list, all lists sorted and deduplicated, and singleton diff lists.
Fields§
§keys: Lists<ContainerOf<U::Key>>Outer key list (one entry per group of keys at the trie root).
vals: Lists<ContainerOf<U::Val>>Per-key list of vals.
times: Lists<ContainerOf<U::Time>>Per-val list of times.
diffs: Lists<ContainerOf<U::Diff>>Per-time list of diffs (one diff per time after consolidation).
Implementations§
Source§impl<U: Update> UpdatesTyped<U>
impl<U: Update> UpdatesTyped<U>
Sourcepub fn view(&self) -> UpdatesView<'_, U>
pub fn view(&self) -> UpdatesView<'_, U>
Borrow the four columns as a single UpdatesView.
Source§impl<U: Update> UpdatesTyped<U>
impl<U: Update> UpdatesTyped<U>
Sourcepub fn extend_from_keys(
&mut self,
other: UpdatesView<'_, U>,
key_range: Range<usize>,
)
pub fn extend_from_keys( &mut self, other: UpdatesView<'_, U>, key_range: Range<usize>, )
Copies other[key_range] into self, keys and all.
Sourcepub fn form_unsorted<'a>(
unsorted: impl Iterator<Item = Ref<'a, Tuple<U>>>,
) -> Self
pub fn form_unsorted<'a>( unsorted: impl Iterator<Item = Ref<'a, Tuple<U>>>, ) -> Self
Forms a consolidated UpdatesTyped trie from unsorted (key, val, time, diff) refs.
Sourcepub fn form<'a>(sorted: impl Iterator<Item = Ref<'a, Tuple<U>>>) -> Self
pub fn form<'a>(sorted: impl Iterator<Item = Ref<'a, Tuple<U>>>) -> Self
Forms a consolidated UpdatesTyped trie from sorted (key, val, time, diff) refs.
Sourcepub fn consolidate(self) -> Self
pub fn consolidate(self) -> Self
Consolidates into canonical trie form: single outer key list, all lists sorted and deduplicated, diff lists are singletons (or absent if cancelled).
Sourcepub fn filter_zero(self) -> Self
pub fn filter_zero(self) -> Self
Drop entries whose diff list is empty (cancelled), rebuilding the trie.
Trait Implementations§
Source§impl<U: Update> Accountable for UpdatesTyped<U>
impl<U: Update> Accountable for UpdatesTyped<U>
Source§impl<U: Update> Clone for UpdatesTyped<U>
impl<U: Update> Clone for UpdatesTyped<U>
Source§impl<U: Update> ContainerBytes for UpdatesTyped<U>
impl<U: Update> ContainerBytes for UpdatesTyped<U>
Source§fn from_bytes(_bytes: Bytes) -> Self
fn from_bytes(_bytes: Bytes) -> Self
Self.Source§fn length_in_bytes(&self) -> usize
fn length_in_bytes(&self) -> usize
Source§fn into_bytes<W: Write>(&self, _writer: &mut W)
fn into_bytes<W: Write>(&self, _writer: &mut W)
writer.Source§impl<U: Update> Debug for UpdatesTyped<U>
impl<U: Update> Debug for UpdatesTyped<U>
Source§impl<U: Update> Default for UpdatesTyped<U>
impl<U: Update> Default for UpdatesTyped<U>
Source§impl<U: Update, B> From<UpdatesTyped<U>> for Updates<U, B>
impl<U: Update, B> From<UpdatesTyped<U>> for Updates<U, B>
Source§fn from(owned: UpdatesTyped<U>) -> Self
fn from(owned: UpdatesTyped<U>) -> Self
Source§impl<KP, VP, TP, DP, U: Update> Push<(KP, VP, TP, DP)> for UpdatesTyped<U>where
ContainerOf<U::Key>: Push<KP>,
ContainerOf<U::Val>: Push<VP>,
ContainerOf<U::Time>: Push<TP>,
ContainerOf<U::Diff>: Push<DP>,
Push a single flat update as a stride-1 entry.
impl<KP, VP, TP, DP, U: Update> Push<(KP, VP, TP, DP)> for UpdatesTyped<U>where
ContainerOf<U::Key>: Push<KP>,
ContainerOf<U::Val>: Push<VP>,
ContainerOf<U::Time>: Push<TP>,
ContainerOf<U::Diff>: Push<DP>,
Push a single flat update as a stride-1 entry.
Each field is independently typed — columnar refs, &Owned, owned values,
or any other type the column container accepts via its Push impl.
Source§fn push(&mut self, (key, val, time, diff): (KP, VP, TP, DP))
fn push(&mut self, (key, val, time, diff): (KP, VP, TP, DP))
self.Source§fn extend(&mut self, iter: impl IntoIterator<Item = T>)
fn extend(&mut self, iter: impl IntoIterator<Item = T>)
self.Source§impl<U: Update> PushInto<((<U as ColumnarUpdate>::Key, <U as ColumnarUpdate>::Val), <U as ColumnarUpdate>::Time, <U as ColumnarUpdate>::Diff)> for UpdatesTyped<U>
PushInto for the ((K, V), T, R) shape that reduce_trace uses.
impl<U: Update> PushInto<((<U as ColumnarUpdate>::Key, <U as ColumnarUpdate>::Val), <U as ColumnarUpdate>::Time, <U as ColumnarUpdate>::Diff)> for UpdatesTyped<U>
PushInto for the ((K, V), T, R) shape that reduce_trace uses.
Source§impl<U: Update> PushInto<UpdatesTyped<U>> for MergeBatcher<U>
impl<U: Update> PushInto<UpdatesTyped<U>> for MergeBatcher<U>
Source§fn push_into(&mut self, chunk: UpdatesTyped<U>)
fn push_into(&mut self, chunk: UpdatesTyped<U>)
Auto Trait Implementations§
impl<U> Freeze for UpdatesTyped<U>where
<<U as ColumnarUpdate>::Key as Columnar>::Container: Freeze,
<<U as ColumnarUpdate>::Val as Columnar>::Container: Freeze,
<<U as ColumnarUpdate>::Time as Columnar>::Container: Freeze,
<<U as ColumnarUpdate>::Diff as Columnar>::Container: Freeze,
impl<U> RefUnwindSafe for UpdatesTyped<U>where
<<U as ColumnarUpdate>::Key as Columnar>::Container: RefUnwindSafe,
<<U as ColumnarUpdate>::Val as Columnar>::Container: RefUnwindSafe,
<<U as ColumnarUpdate>::Time as Columnar>::Container: RefUnwindSafe,
<<U as ColumnarUpdate>::Diff as Columnar>::Container: RefUnwindSafe,
impl<U> Send for UpdatesTyped<U>
impl<U> Sync for UpdatesTyped<U>where
<<U as ColumnarUpdate>::Key as Columnar>::Container: Sync,
<<U as ColumnarUpdate>::Val as Columnar>::Container: Sync,
<<U as ColumnarUpdate>::Time as Columnar>::Container: Sync,
<<U as ColumnarUpdate>::Diff as Columnar>::Container: Sync,
impl<U> Unpin for UpdatesTyped<U>where
<<U as ColumnarUpdate>::Key as Columnar>::Container: Unpin,
<<U as ColumnarUpdate>::Val as Columnar>::Container: Unpin,
<<U as ColumnarUpdate>::Time as Columnar>::Container: Unpin,
<<U as ColumnarUpdate>::Diff as Columnar>::Container: Unpin,
impl<U> UnsafeUnpin for UpdatesTyped<U>where
<<U as ColumnarUpdate>::Key as Columnar>::Container: UnsafeUnpin,
<<U as ColumnarUpdate>::Val as Columnar>::Container: UnsafeUnpin,
<<U as ColumnarUpdate>::Time as Columnar>::Container: UnsafeUnpin,
<<U as ColumnarUpdate>::Diff as Columnar>::Container: UnsafeUnpin,
impl<U> UnwindSafe for UpdatesTyped<U>where
<<U as ColumnarUpdate>::Key as Columnar>::Container: UnwindSafe,
<<U as ColumnarUpdate>::Val as Columnar>::Container: UnwindSafe,
<<U as ColumnarUpdate>::Time as Columnar>::Container: UnwindSafe,
<<U as ColumnarUpdate>::Diff as Columnar>::Container: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
Source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign, for types that do not implement AddAssign.