Struct rkyv::time::ArchivedDuration
source · #[repr(C)]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<C: Fallible + ?Sized> CheckBytes<C> for ArchivedDuration
impl<C: Fallible + ?Sized> CheckBytes<C> for ArchivedDuration
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 moreimpl Copy for ArchivedDuration
impl Eq for ArchivedDuration
impl StructuralPartialEq for ArchivedDuration
Auto Trait Implementations§
impl Freeze for ArchivedDuration
impl RefUnwindSafe for ArchivedDuration
impl Send for ArchivedDuration
impl Sync for ArchivedDuration
impl Unpin for ArchivedDuration
impl UnwindSafe for ArchivedDuration
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
source§impl<T> CallHasher for T
impl<T> CallHasher for T
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.