Struct rkyv::time::ArchivedDuration
source · [−]pub struct ArchivedDuration { /* private fields */ }
Expand description
An archived Duration
.
Implementations
sourceimpl 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
sourceimpl Clone for ArchivedDuration
impl Clone for ArchivedDuration
sourcefn clone(&self) -> ArchivedDuration
fn clone(&self) -> ArchivedDuration
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ArchivedDuration
impl Debug for ArchivedDuration
sourceimpl Default for ArchivedDuration
impl Default for ArchivedDuration
sourcefn default() -> ArchivedDuration
fn default() -> ArchivedDuration
Returns the “default value” for a type. Read more
sourceimpl<D: Fallible + ?Sized> Deserialize<Duration, D> for ArchivedDuration
impl<D: Fallible + ?Sized> Deserialize<Duration, D> for ArchivedDuration
sourceimpl<D: Fallible + ?Sized> DeserializeWith<ArchivedDuration, SystemTime, D> for UnixTimestamp
impl<D: Fallible + ?Sized> DeserializeWith<ArchivedDuration, SystemTime, D> for UnixTimestamp
sourcefn deserialize_with(
field: &ArchivedDuration,
_: &mut D
) -> Result<SystemTime, D::Error>
fn deserialize_with(
field: &ArchivedDuration,
_: &mut D
) -> Result<SystemTime, D::Error>
Deserializes the field type F
using the given deserializer.
sourceimpl From<ArchivedDuration> for Duration
impl From<ArchivedDuration> for Duration
sourcefn from(duration: ArchivedDuration) -> Self
fn from(duration: ArchivedDuration) -> Self
Performs the conversion.
sourceimpl Hash for ArchivedDuration
impl Hash for ArchivedDuration
sourceimpl Ord for ArchivedDuration
impl Ord for ArchivedDuration
sourceimpl PartialEq<ArchivedDuration> for Duration
impl PartialEq<ArchivedDuration> for Duration
sourceimpl PartialEq<ArchivedDuration> for ArchivedDuration
impl PartialEq<ArchivedDuration> for ArchivedDuration
sourcefn eq(&self, other: &ArchivedDuration) -> bool
fn eq(&self, other: &ArchivedDuration) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ArchivedDuration) -> bool
fn ne(&self, other: &ArchivedDuration) -> bool
This method tests for !=
.
sourceimpl PartialEq<Duration> for ArchivedDuration
impl PartialEq<Duration> for ArchivedDuration
sourceimpl PartialOrd<ArchivedDuration> for ArchivedDuration
impl PartialOrd<ArchivedDuration> for ArchivedDuration
sourcefn partial_cmp(&self, other: &ArchivedDuration) -> Option<Ordering>
fn partial_cmp(&self, other: &ArchivedDuration) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for ArchivedDuration
impl Eq for ArchivedDuration
impl StructuralEq for ArchivedDuration
impl StructuralPartialEq for ArchivedDuration
Auto Trait Implementations
impl RefUnwindSafe for ArchivedDuration
impl Send for ArchivedDuration
impl Sync for ArchivedDuration
impl Unpin for ArchivedDuration
impl UnwindSafe for ArchivedDuration
Blanket Implementations
sourceimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
sourcefn pointer_metadata(_: &Self::ArchivedMetadata) -> <Self as Pointee>::Metadata
fn pointer_metadata(_: &Self::ArchivedMetadata) -> <Self as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more