pub struct TimeHistory<T> { /* private fields */ }Expand description
Replays a set of times in ascending order, maintaining the meet of the times not yet
replayed and a deduplicated buffer of replayed times advanced by that meet. A cheaper
ValueHistory for callers that need time structure only (no values, no cancellation).
Implementations§
Source§impl<T: Lattice + Clone + Ord> TimeHistory<T>
impl<T: Lattice + Clone + Ord> TimeHistory<T>
Sourcepub fn load(&mut self, times: impl Iterator<Item = T>, advance_by: Option<&T>)
pub fn load(&mut self, times: impl Iterator<Item = T>, advance_by: Option<&T>)
Load times, advancing each by advance_by if supplied, and organize the replay
(sort + suffix meets).
Sourcepub fn step_while_time_is(&mut self, time: &T) -> bool
pub fn step_while_time_is(&mut self, time: &T) -> bool
Step times while the next equals time; true iff any did.
Sourcepub fn advance_buffer_by(&mut self, meet: &T)
pub fn advance_buffer_by(&mut self, meet: &T)
Advance buffered times by meet and deduplicate — the collapse that keeps replay
linear.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for TimeHistory<T>
impl<T> RefUnwindSafe for TimeHistory<T>where
T: RefUnwindSafe,
impl<T> Send for TimeHistory<T>where
T: Send,
impl<T> Sync for TimeHistory<T>where
T: Sync,
impl<T> Unpin for TimeHistory<T>where
T: Unpin,
impl<T> UnsafeUnpin for TimeHistory<T>
impl<T> UnwindSafe for TimeHistory<T>where
T: 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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)
The method of
std::ops::AddAssign, for types that do not implement AddAssign.