Struct rkyv_test::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<__C: ?Sized> CheckBytes<__C> for ArchivedDuration where
Archived<u64>: CheckBytes<__C>,
Archived<u32>: CheckBytes<__C>,
impl<__C: ?Sized> CheckBytes<__C> for ArchivedDuration where
Archived<u64>: CheckBytes<__C>,
Archived<u32>: CheckBytes<__C>,
type Error = StructCheckError
type Error = StructCheckError
The error that may result from checking the type.
sourceunsafe fn check_bytes<'__bytecheck>(
value: *const Self,
context: &mut __C
) -> Result<&'__bytecheck Self, StructCheckError>
unsafe fn check_bytes<'__bytecheck>(
value: *const Self,
context: &mut __C
) -> Result<&'__bytecheck Self, StructCheckError>
Checks whether the given pointer points to a valid value within the given context. Read more
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
Converts to this type from the input type.
sourceimpl Hash for ArchivedDuration
impl Hash for ArchivedDuration
sourceimpl Ord for ArchivedDuration
impl Ord for ArchivedDuration
sourcefn cmp(&self, other: &ArchivedDuration) -> Ordering
fn cmp(&self, other: &ArchivedDuration) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
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
sourceimpl PartialEq<ArchivedDuration> for Duration
impl PartialEq<ArchivedDuration> for Duration
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
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(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T 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 · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more