pub trait Clock:
Debug
+ Send
+ Sync {
// Required method
fn now(&self) -> Result<DateTime<Utc>, ClockError>;
// Provided method
fn unix_seconds(&self) -> Result<u64, ClockError> { ... }
}Expand description
A UTC clock supplied when an owner is constructed.
Required Methods§
Provided Methods§
Sourcefn unix_seconds(&self) -> Result<u64, ClockError>
fn unix_seconds(&self) -> Result<u64, ClockError>
Returns this instance’s current whole unsigned Unix second.
§Errors
Propagates the provider’s failure and refuses pre-epoch instants.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".