pub struct TimeOfDay(/* private fields */);Expand description
Represents a time in 48-bits, as stored in TimeOfDay objects
Implementations§
Source§impl TimeOfDay
impl TimeOfDay
Sourcepub const EPOCH: TimeOfDay
pub const EPOCH: TimeOfDay
A zero-inintialized TimeOfDay corresponding to the TimeOfDay epoch of 1984-01-01
Sourcepub fn new(days: u16, ms: u32) -> Self
pub fn new(days: u16, ms: u32) -> Self
Create a new TimeOfDay
§Arguments
days: The number of days since January 1, 1984ms: The number of milliseconds after midnight
Sourcepub fn from_ymd_hms_ms(
year: u32,
month: u32,
day: u32,
hour: u32,
min: u32,
sec: u32,
milli: u32,
) -> Result<Self, TimeCreateError>
pub fn from_ymd_hms_ms( year: u32, month: u32, day: u32, hour: u32, min: u32, sec: u32, milli: u32, ) -> Result<Self, TimeCreateError>
Create a TimeOfDay corresponding to the provided date and time
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]
Get the little endian byte representation of the time of day
Sourcepub fn time_hmsm(&self) -> (u32, u32, u32, u32)
pub fn time_hmsm(&self) -> (u32, u32, u32, u32)
Get the time of day as (hour, min, sec, millis)
Sourcepub fn time_millis(&self) -> u32
pub fn time_millis(&self) -> u32
Get the time of day as the number of milliseconds since midnight
Sourcepub fn time_duration(&self) -> Duration
pub fn time_duration(&self) -> Duration
Get the time of of day as a Duration since midnight
Sourcepub fn total_millis(&self) -> u64
pub fn total_millis(&self) -> u64
Get the total number of milliseconds since 1984-01-01
Sourcepub fn as_system_time(&self) -> SystemTime
Available on crate feature std only.
pub fn as_system_time(&self) -> SystemTime
std only.Get the time represented as a SystemTime
Trait Implementations§
impl Copy for TimeOfDay
impl Eq for TimeOfDay
impl StructuralPartialEq for TimeOfDay
Auto Trait Implementations§
impl Freeze for TimeOfDay
impl RefUnwindSafe for TimeOfDay
impl Send for TimeOfDay
impl Sync for TimeOfDay
impl Unpin for TimeOfDay
impl UnwindSafe for TimeOfDay
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