pub struct Incr(/* private fields */);
Expand description
A self-contained struct for quickly checking whether a newly observed value is greater than any previously observed value.
Examples
use incr::Incr;
let mut last = Incr::default();
assert_eq!(last.is_new(1), true);
assert_eq!(last.is_new(1), false);
assert_eq!(last.is_new(2), true);
assert_eq!(last.get(), 2);
Implementations§
Trait Implementations§
source§impl PartialEq<Incr> for Incr
impl PartialEq<Incr> for Incr
source§impl PartialOrd<Incr> for Incr
impl PartialOrd<Incr> for Incr
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Incr
impl StructuralEq for Incr
impl StructuralPartialEq for Incr
Auto Trait Implementations§
impl RefUnwindSafe for Incr
impl Send for Incr
impl Sync for Incr
impl Unpin for Incr
impl UnwindSafe for Incr
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