pub struct Instant<'a, R: Rate>(/* private fields */);Expand description
A point in the tick count.
Comparable and subtractable, and bounded to the Timer it came from: a
count that stopped and started again would leave it meaning nothing.
Implementations§
Source§impl<R: Rate> Instant<'_, R>
impl<R: Rate> Instant<'_, R>
Sourcepub fn saturating_duration_since(self, earlier: Self) -> Duration<R>
pub fn saturating_duration_since(self, earlier: Self) -> Duration<R>
How long from earlier to this.
Zero if earlier is the later of the two.
Sourcepub fn checked_duration_since(self, earlier: Self) -> Option<Duration<R>>
pub fn checked_duration_since(self, earlier: Self) -> Option<Duration<R>>
How long from earlier to this, or None if earlier is the later.
Trait Implementations§
impl<R: Rate> Copy for Instant<'_, R>
impl<R: Rate> Eq for Instant<'_, R>
Source§impl<R: Rate> Ord for Instant<'_, R>
impl<R: Rate> Ord for Instant<'_, R>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<R: Rate> PartialOrd for Instant<'_, R>
impl<R: Rate> PartialOrd for Instant<'_, R>
Auto Trait Implementations§
impl<'a, R> !Send for Instant<'a, R>
impl<'a, R> !Sync for Instant<'a, R>
impl<'a, R> BankSafe for Instant<'a, R>where
R: BankSafe,
impl<'a, R> Freeze for Instant<'a, R>
impl<'a, R> RefUnwindSafe for Instant<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Unpin for Instant<'a, R>
impl<'a, R> UnsafeUnpin for Instant<'a, R>
impl<'a, R> UnwindSafe for Instant<'a, R>where
R: RefUnwindSafe,
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