pub struct Duration<T, U = NsUnit>(/* private fields */);
Implementations§
Source§impl<T: Timeline> Duration<T, NsUnit>
impl<T: Timeline> Duration<T, NsUnit>
pub const INFINITE: Duration<T> = _
pub const INFINITE_PAST: Duration<T> = _
pub const ZERO: Duration<T> = _
Sourcepub const fn into_nanos(self) -> i64
pub const fn into_nanos(self) -> i64
Returns the number of nanoseconds contained by this Duration
.
Sourcepub const fn into_micros(self) -> i64
pub const fn into_micros(self) -> i64
Returns the total number of whole microseconds contained by this Duration
.
Sourcepub const fn into_millis(self) -> i64
pub const fn into_millis(self) -> i64
Returns the total number of whole milliseconds contained by this Duration
.
Sourcepub const fn into_seconds(self) -> i64
pub const fn into_seconds(self) -> i64
Returns the total number of whole seconds contained by this Duration
.
Sourcepub fn into_seconds_f64(self) -> f64
pub fn into_seconds_f64(self) -> f64
Returns the duration as a floating-point value in seconds.
Sourcepub const fn into_minutes(self) -> i64
pub const fn into_minutes(self) -> i64
Returns the total number of whole minutes contained by this Duration
.
Sourcepub const fn into_hours(self) -> i64
pub const fn into_hours(self) -> i64
Returns the total number of whole hours contained by this Duration
.
pub const fn from_nanos(nanos: i64) -> Self
pub const fn from_micros(micros: i64) -> Self
pub const fn from_millis(millis: i64) -> Self
pub const fn from_seconds(secs: i64) -> Self
pub const fn from_minutes(min: i64) -> Self
pub const fn from_hours(hours: i64) -> Self
Trait Implementations§
Source§impl<T: Timeline, U: TimeUnit> AddAssign<Duration<T, U>> for Instant<T, U>
impl<T: Timeline, U: TimeUnit> AddAssign<Duration<T, U>> for Instant<T, U>
Source§fn add_assign(&mut self, dur: Duration<T, U>)
fn add_assign(&mut self, dur: Duration<T, U>)
Performs the
+=
operation. Read moreSource§impl<T: Timeline, U: TimeUnit> AddAssign for Duration<T, U>
impl<T: Timeline, U: TimeUnit> AddAssign for Duration<T, U>
Source§fn add_assign(&mut self, rhs: Duration<T, U>)
fn add_assign(&mut self, rhs: Duration<T, U>)
Performs the
+=
operation. Read moreSource§impl<T: Ord, U: Ord> Ord for Duration<T, U>
impl<T: Ord, U: Ord> Ord for Duration<T, U>
1.21.0 · 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<T: PartialOrd, U: PartialOrd> PartialOrd for Duration<T, U>
impl<T: PartialOrd, U: PartialOrd> PartialOrd for Duration<T, U>
Source§impl<T: Timeline, U: TimeUnit> SubAssign<Duration<T, U>> for Instant<T, U>
impl<T: Timeline, U: TimeUnit> SubAssign<Duration<T, U>> for Instant<T, U>
Source§fn sub_assign(&mut self, dur: Duration<T, U>)
fn sub_assign(&mut self, dur: Duration<T, U>)
Performs the
-=
operation. Read moreSource§impl<T: Timeline, U: TimeUnit> SubAssign for Duration<T, U>
impl<T: Timeline, U: TimeUnit> SubAssign for Duration<T, U>
Source§fn sub_assign(&mut self, rhs: Duration<T, U>)
fn sub_assign(&mut self, rhs: Duration<T, U>)
Performs the
-=
operation. Read moreimpl<T: Copy, U: Copy> Copy for Duration<T, U>
impl<T: Eq, U: Eq> Eq for Duration<T, U>
impl<T, U> StructuralPartialEq for Duration<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for Duration<T, U>
impl<T, U> RefUnwindSafe for Duration<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for Duration<T, U>
impl<T, U> Sync for Duration<T, U>
impl<T, U> Unpin for Duration<T, U>
impl<T, U> UnwindSafe for Duration<T, U>where
T: UnwindSafe,
U: UnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)