pub enum UtcTime {
Reliable(u64),
LastKnown(u64),
}Expand description
An enum describing the current UTC timestamp the real-time clock is aware of.
The timestamp is expressed as Matter-epoch microseconds.
Variants§
Reliable(u64)
The RTC is actively tracking the current time, anchored at the given Matter-epoch microseconds value.
LastKnown(u64)
The RTC is not currently tracking the current time, but the given Matter-epoch microseconds value is the last known good UTC time persisted on the device.
Do note that a “last known” time is always available, as the firmware build timestamp is used as the initial value on a freshly-flashed device.
Implementations§
Source§impl UtcTime
impl UtcTime
Sourcepub const fn reliable(&self) -> Option<u64>
pub const fn reliable(&self) -> Option<u64>
Return the current UTC time if available, or None if no reliable time is currently tracked.
Sourcepub const fn any(&self) -> u64
pub const fn any(&self) -> u64
Return the current UTC time if available, or the persisted LKG UTC otherwise.
Sourcepub const fn reliable_secs(&self) -> Option<u64>
pub const fn reliable_secs(&self) -> Option<u64>
Return the current UTC time in seconds if available, or None if no reliable time is currently tracked.
Trait Implementations§
impl Copy for UtcTime
impl Eq for UtcTime
impl StructuralPartialEq for UtcTime
Auto Trait Implementations§
impl Freeze for UtcTime
impl RefUnwindSafe for UtcTime
impl Send for UtcTime
impl Sync for UtcTime
impl Unpin for UtcTime
impl UnsafeUnpin for UtcTime
impl UnwindSafe for UtcTime
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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