pub struct Instant(/* private fields */);Expand description
Implementations§
Source§impl Instant
impl Instant
Sourcepub fn duration_since(&self, earlier: Self) -> Duration
pub fn duration_since(&self, earlier: Self) -> Duration
The time from earlier to this instant, zero if earlier is later.
Sourcepub fn checked_duration_since(&self, earlier: Self) -> Option<Duration>
pub fn checked_duration_since(&self, earlier: Self) -> Option<Duration>
The time from earlier to this instant, None if earlier is later.
Sourcepub fn saturating_duration_since(&self, earlier: Self) -> Duration
pub fn saturating_duration_since(&self, earlier: Self) -> Duration
The time from earlier to this instant, zero if earlier is later.
Sourcepub fn checked_add(&self, duration: Duration) -> Option<Self>
pub fn checked_add(&self, duration: Duration) -> Option<Self>
This instant moved forward by duration, None past the clock’s range.
Sourcepub fn checked_sub(&self, duration: Duration) -> Option<Self>
pub fn checked_sub(&self, duration: Duration) -> Option<Self>
This instant moved back by duration, None before the clock’s range.
Trait Implementations§
Source§impl AddAssign<Duration> for Instant
impl AddAssign<Duration> for Instant
Source§fn add_assign(&mut self, duration: Duration)
fn add_assign(&mut self, duration: Duration)
Performs the
+= operation. Read moreimpl 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
Source§impl PartialOrd for Instant
impl PartialOrd for Instant
impl StructuralPartialEq for Instant
Auto Trait Implementations§
impl Freeze 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