pub struct Instant { /* private fields */ }Expand description
A point on a Clock’s timeline.
Opaque and only meaningful against other instants of the same clock. Unlike
std::time::Instant, which does not advance while the machine sleeps on
the platforms the agent supports, the timeline of the SystemClock keeps
counting through sleep.
Implementations§
Source§impl Instant
impl Instant
Sourcepub const fn checked_duration_since(self, earlier: Self) -> Option<Duration>
pub const fn checked_duration_since(self, earlier: Self) -> Option<Duration>
Time from earlier to self, or None when earlier is later.
Sourcepub const fn duration_since(self, earlier: Self) -> Duration
pub const fn duration_since(self, earlier: Self) -> Duration
Time from earlier to self, zero when earlier is later.
Sourcepub fn checked_add(self, by: Duration) -> Option<Self>
pub fn checked_add(self, by: Duration) -> Option<Self>
self moved forward by by, or None on overflow.
Sourcepub fn checked_sub(self, by: Duration) -> Option<Self>
pub fn checked_sub(self, by: Duration) -> Option<Self>
self moved back by by, or None when that precedes the origin.
Trait Implementations§
impl Copy for Instant
impl Eq for Instant
Source§impl Ord for Instant
impl Ord for Instant
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Instant
impl PartialOrd for Instant
impl StructuralPartialEq for Instant
Auto Trait Implementations§
impl Forget for Instant
impl Freeze for Instant
impl Move for Instant
impl RefUnwindSafe for Instant
impl Send for Instant
impl Sync for Instant
impl Unpin for Instant
impl UnsafeUnpin for Instant
impl UnwindSafe for Instant
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.