pub type SyntheticDuration = Duration<SyntheticTimeline, NsUnit>;
Expand description
A duration from a user-defined clock with arbitrary behavior.
Aliased Type§
struct SyntheticDuration(/* 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 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, U> FromBytes for Duration<T, U>
impl<T, U> FromBytes for Duration<T, U>
Source§impl<T, U> IntoBytes for Duration<T, U>
impl<T, U> IntoBytes for Duration<T, U>
§fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
Gets the bytes of this value mutably. Read more
§fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
Source§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 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 more