pub struct InstantTime;Expand description
Time implementation for std::time::Instant.
instant_sub panics if a < b because Duration cannot
represent negative values. Use Time::instant_cmp to compare instants.
Trait Implementations§
Source§impl Time for InstantTime
impl Time for InstantTime
type Instant = Instant
type Duration = Duration
Source§fn instant_sub(a: Self::Instant, b: Self::Instant) -> Self::Duration
fn instant_sub(a: Self::Instant, b: Self::Instant) -> Self::Duration
Returns
a - b. Behavior when a < b is unspecified: implementations may
panic or return a meaningless value. Use instant_cmp to
check ordering first if unsure.Source§fn duration_sub(a: Self::Duration, b: Self::Duration) -> Self::Duration
fn duration_sub(a: Self::Duration, b: Self::Duration) -> Self::Duration
Returns
a - b. Behavior when a < b is unspecified: implementations may
panic or return a meaningless value.fn duration_add(a: Self::Duration, b: Self::Duration) -> Self::Duration
fn mixed_sub(a: Self::Instant, b: Self::Duration) -> Self::Instant
fn mixed_add(a: Self::Instant, b: Self::Duration) -> Self::Instant
fn instant_cmp(a: Self::Instant, b: Self::Instant) -> Ordering
Auto Trait Implementations§
impl Freeze for InstantTime
impl RefUnwindSafe for InstantTime
impl Send for InstantTime
impl Sync for InstantTime
impl Unpin for InstantTime
impl UnsafeUnpin for InstantTime
impl UnwindSafe for InstantTime
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