pub struct ValueHistory<V, T, D> { /* private fields */ }Expand description
A loaded, time-ordered replay of one key’s (value, time, diff) edits, with meet-advanced
buffer collapse — the shared machinery under the cursor reduce, the int_proxy tactics, and
the common helpers. Its local contract: after
advance_buffer_by(meet) with the meet of the un-replayed times, the buffer is consolidated
and replay cost stays linear in edits rather than quadratic.
Implementations§
Source§impl<V: Copy + Ord, T: Ord + Clone + Lattice, D: Semigroup> ValueHistory<V, T, D>
impl<V: Copy + Ord, T: Ord + Clone + Lattice, D: Semigroup> ValueHistory<V, T, D>
Sourcepub fn load_iter(
&mut self,
edits: impl Iterator<Item = (V, T, D)>,
advance_by: Option<&T>,
)
pub fn load_iter( &mut self, edits: impl Iterator<Item = (V, T, D)>, advance_by: Option<&T>, )
Loads edits from a plain iterator (grouped by consecutive value — the presentation
order), advancing each time by advance_by if supplied, then organizes. This is the
cursor-free ingestion path: the int_proxy tactics present (value_id, time, diff)
runs directly rather than through a Cursor, and share this machinery instead of
re-implementing it. Ungrouped input is still correct, only less compact.
Source§impl<V: Copy + Ord, T: Ord + Clone + Lattice, D: Clone + Semigroup> ValueHistory<V, T, D>
impl<V: Copy + Ord, T: Ord + Clone + Lattice, D: Clone + Semigroup> ValueHistory<V, T, D>
Sourcepub fn buffer(&self) -> &[((V, T), D)]
pub fn buffer(&self) -> &[((V, T), D)]
The buffered (stepped-in, advanced, consolidated) edits.
Sourcepub fn step_while_time_is(&mut self, time: &T) -> bool
pub fn step_while_time_is(&mut self, time: &T) -> bool
Step edits while the next time equals time; true iff any did.
Sourcepub fn step_through(&mut self, time: &T)
pub fn step_through(&mut self, time: &T)
Step edits while the next time is <= time in the TOTAL order (a superset of the
partially-ordered downset; readers filter the buffer by less_equal themselves).
Sourcepub fn advance_buffer_by(&mut self, meet: &T)
pub fn advance_buffer_by(&mut self, meet: &T)
Advance buffered times by meet and consolidate — the collapse that keeps replay linear.
Auto Trait Implementations§
impl<V, T, D> Freeze for ValueHistory<V, T, D>
impl<V, T, D> RefUnwindSafe for ValueHistory<V, T, D>
impl<V, T, D> Send for ValueHistory<V, T, D>
impl<V, T, D> Sync for ValueHistory<V, T, D>
impl<V, T, D> Unpin for ValueHistory<V, T, D>
impl<V, T, D> UnsafeUnpin for ValueHistory<V, T, D>
impl<V, T, D> UnwindSafe for ValueHistory<V, T, D>
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> 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.