pub trait Clock {
// Required method
fn utc(&self) -> Option<u64>;
// Provided methods
fn set_utc(&self, _micros: u64) -> Result<()> { ... }
fn granularity(&self) -> Granularity { ... }
}Expand description
Wall-clock time in UTC.
Separate from Timer because most nodes do not have one: a light with no real-time
clock and no Time Synchronization cluster implements NoClock and is none the worse.
Matter never uses wall-clock time for protocol deadlines, only for the Time
Synchronization cluster and for certificate validity.
Required Methods§
Provided Methods§
Sourcefn set_utc(&self, _micros: u64) -> Result<()>
fn set_utc(&self, _micros: u64) -> Result<()>
Sets the current time, if the platform can. A node that cannot returns
Err(ErrorCode::Platform); the Time Synchronization cluster reports that honestly
rather than pretending the write worked.
Sourcefn granularity(&self) -> Granularity
fn granularity(&self) -> Granularity
How precise Clock::utc is, as the Time Synchronization cluster’s
Granularity enumeration.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".