pub struct ValueTracker<T: Clone> { /* private fields */ }Expand description
Value tracker for monitoring changes over time
Useful for EDD (Equation-Driven Development) where you want to verify that values change according to expected patterns.
Implementations§
Source§impl<T: Clone> ValueTracker<T>
impl<T: Clone> ValueTracker<T>
Source§impl<T: Clone + PartialEq> ValueTracker<T>
impl<T: Clone + PartialEq> ValueTracker<T>
Sourcepub fn has_changed(&self) -> bool
pub fn has_changed(&self) -> bool
Check if value changed since last recording
Sourcepub fn change_count(&self) -> usize
pub fn change_count(&self) -> usize
Count how many times the value changed
Source§impl ValueTracker<f64>
impl ValueTracker<f64>
Sourcepub fn rate_of_change(&self) -> Option<f64>
pub fn rate_of_change(&self) -> Option<f64>
Calculate the rate of change (delta per millisecond)
Sourcepub fn is_increasing(&self) -> bool
pub fn is_increasing(&self) -> bool
Check if value is monotonically increasing
Sourcepub fn is_decreasing(&self) -> bool
pub fn is_decreasing(&self) -> bool
Check if value is monotonically decreasing
Source§impl ValueTracker<i64>
impl ValueTracker<i64>
Sourcepub fn is_increasing(&self) -> bool
pub fn is_increasing(&self) -> bool
Check if value is monotonically increasing
Sourcepub fn is_decreasing(&self) -> bool
pub fn is_decreasing(&self) -> bool
Check if value is monotonically decreasing
Trait Implementations§
Source§impl<T: Clone + Clone> Clone for ValueTracker<T>
impl<T: Clone + Clone> Clone for ValueTracker<T>
Source§fn clone(&self) -> ValueTracker<T>
fn clone(&self) -> ValueTracker<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for ValueTracker<T>
impl<T> RefUnwindSafe for ValueTracker<T>where
T: RefUnwindSafe,
impl<T> Send for ValueTracker<T>where
T: Send,
impl<T> Sync for ValueTracker<T>where
T: Sync,
impl<T> Unpin for ValueTracker<T>where
T: Unpin,
impl<T> UnsafeUnpin for ValueTracker<T>
impl<T> UnwindSafe for ValueTracker<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> 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>
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 more