pub struct TimeDifference { /* private fields */ }Expand description
Represents a duration of time in 48-bits, as stored in TimeDifference objects
Implementations§
Source§impl TimeDifference
impl TimeDifference
Sourcepub const SIZE: usize = 6
pub const SIZE: usize = 6
The size of a TimeDifference object in bytes as stored in the object dict
Sourcepub const ZERO: TimeDifference
pub const ZERO: TimeDifference
A zero time difference
Sourcepub const fn new(days: u16, ms: u32) -> Self
pub const fn new(days: u16, ms: u32) -> Self
Create a new time difference from the raw u32 value
Sourcepub fn from_le_bytes(bytes: [u8; 6]) -> Self
pub fn from_le_bytes(bytes: [u8; 6]) -> Self
Create a TimeOfDay from little endian bytes
Sourcepub fn to_le_bytes(&self) -> [u8; 6]
pub fn to_le_bytes(&self) -> [u8; 6]
Return the little endian byte representation of the TimeDifference
Sourcepub fn total_millis(&self) -> u64
pub fn total_millis(&self) -> u64
Get the time duration as milliseconds
Sourcepub fn as_duration(&self) -> Duration
pub fn as_duration(&self) -> Duration
Convert to a core::time::Duration
Trait Implementations§
Source§impl Clone for TimeDifference
impl Clone for TimeDifference
Source§fn clone(&self) -> TimeDifference
fn clone(&self) -> TimeDifference
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TimeDifference
impl Debug for TimeDifference
Source§impl Default for TimeDifference
impl Default for TimeDifference
Source§fn default() -> TimeDifference
fn default() -> TimeDifference
Returns the “default value” for a type. Read more
Source§impl PartialEq for TimeDifference
impl PartialEq for TimeDifference
impl Copy for TimeDifference
impl Eq for TimeDifference
impl StructuralPartialEq for TimeDifference
Auto Trait Implementations§
impl Freeze for TimeDifference
impl RefUnwindSafe for TimeDifference
impl Send for TimeDifference
impl Sync for TimeDifference
impl Unpin for TimeDifference
impl UnwindSafe for TimeDifference
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more