pub struct ArchivedDuration { /* private fields */ }Expand description
An archived Duration.
Implementations§
Source§impl ArchivedDuration
impl ArchivedDuration
Sourcepub const fn as_secs(&self) -> u64
pub const fn as_secs(&self) -> u64
Returns the number of whole seconds contained by this
ArchivedDuration.
The returned value does not include the fractional (nanosecond) part of the duration, which
can be obtained using subsec_nanos.
Sourcepub const fn subsec_millis(&self) -> u32
pub const fn subsec_millis(&self) -> u32
Returns the fractional part of this ArchivedDuration, in whole milliseconds.
This method does not return the length of the duration when represented by milliseconds. The returned number always represents a fractional portion of a second (i.e., it is less than one thousand).
Sourcepub const fn subsec_micros(&self) -> u32
pub const fn subsec_micros(&self) -> u32
Returns the fractional part of this ArchivedDuration, in whole microseconds.
This method does not return the length of the duration when represented by microseconds. The returned number always represents a fractional portion of a second (i.e., it is less than one million).
Sourcepub const fn subsec_nanos(&self) -> u32
pub const fn subsec_nanos(&self) -> u32
Returns the fractional part of this Duration, in nanoseconds.
This method does not return the length of the duration when represented by nanoseconds. The returned number always represents a fractional portion of a second (i.e., it is less than one billion).
Sourcepub const fn as_millis(&self) -> u128
pub const fn as_millis(&self) -> u128
Returns the total number of whole milliseconds contained by this ArchivedDuration.
Sourcepub const fn as_micros(&self) -> u128
pub const fn as_micros(&self) -> u128
Returns the total number of whole microseconds contained by this ArchivedDuration.
Sourcepub const fn as_nanos(&self) -> u128
pub const fn as_nanos(&self) -> u128
Returns the total number of nanoseconds contained by this ArchivedDuration.
Sourcepub fn as_secs_f64(&self) -> f64
pub fn as_secs_f64(&self) -> f64
Returns the number of seconds contained by this ArchivedDuration as f64.
The returned value does include the fractional (nanosecond) part of the duration.
Sourcepub fn as_secs_f32(&self) -> f32
pub fn as_secs_f32(&self) -> f32
Returns the number of seconds contained by this ArchivedDuration as f32.
The returned value does include the fractional (nanosecond) part of the duration.
Trait Implementations§
Source§impl Clone for ArchivedDuration
impl Clone for ArchivedDuration
Source§fn clone(&self) -> ArchivedDuration
fn clone(&self) -> ArchivedDuration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArchivedDuration
impl Debug for ArchivedDuration
Source§impl Default for ArchivedDuration
impl Default for ArchivedDuration
Source§fn default() -> ArchivedDuration
fn default() -> ArchivedDuration
Source§impl<D: Fallible + ?Sized> Deserialize<Duration, D> for ArchivedDuration
impl<D: Fallible + ?Sized> Deserialize<Duration, D> for ArchivedDuration
Source§impl<D: Fallible + ?Sized> DeserializeWith<ArchivedDuration, SystemTime, D> for UnixTimestamp
impl<D: Fallible + ?Sized> DeserializeWith<ArchivedDuration, SystemTime, D> for UnixTimestamp
Source§fn deserialize_with(
field: &ArchivedDuration,
_: &mut D,
) -> Result<SystemTime, D::Error>
fn deserialize_with( field: &ArchivedDuration, _: &mut D, ) -> Result<SystemTime, D::Error>
F using the given deserializer.