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 PartialOrd for Incr
impl PartialOrd for Incr
impl Eq for Incr
impl StructuralPartialEq for Incr
Auto Trait Implementations§
impl Freeze for Incr
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