Struct rkyv::time::ArchivedDuration
source · 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.source§impl From<ArchivedDuration> for Duration
impl From<ArchivedDuration> for Duration
source§fn from(duration: ArchivedDuration) -> Self
fn from(duration: ArchivedDuration) -> Self
source§impl Hash for ArchivedDuration
impl Hash for ArchivedDuration
source§impl Ord for ArchivedDuration
impl Ord for ArchivedDuration
source§fn cmp(&self, other: &ArchivedDuration) -> Ordering
fn cmp(&self, other: &ArchivedDuration) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<ArchivedDuration> for Duration
impl PartialEq<ArchivedDuration> for Duration
source§fn eq(&self, other: &ArchivedDuration) -> bool
fn eq(&self, other: &ArchivedDuration) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Duration> for ArchivedDuration
impl PartialEq<Duration> for ArchivedDuration
source§impl PartialEq for ArchivedDuration
impl PartialEq for ArchivedDuration
source§fn eq(&self, other: &ArchivedDuration) -> bool
fn eq(&self, other: &ArchivedDuration) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ArchivedDuration
impl PartialOrd for ArchivedDuration
source§fn partial_cmp(&self, other: &ArchivedDuration) -> Option<Ordering>
fn partial_cmp(&self, other: &ArchivedDuration) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more