pub trait Clock:
Send
+ Sync
+ Debug {
// Required methods
fn elapsed(&self) -> Duration;
fn sleep(
&self,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>;
fn unix_now(&self) -> Duration;
// Provided method
fn today_utc(&self) -> Result<CalendarDate, Error> { ... }
}Expand description
The clock every wait here measures its deadline on. It’s the crate’s one Clock, so the
plane and the sessions it hands out read the same time source.
Time, injectable so a wait or a refresh boundary is a test rather than a wait.
Required Methods§
Provided Methods§
Sourcefn today_utc(&self) -> Result<CalendarDate, Error>
fn today_utc(&self) -> Result<CalendarDate, Error>
Today, UTC, for the cost engine’s dates.
Fails only for a wall reading past 9999-12-31, the last date the domain represents.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".