pub trait Clock:
Send
+ Sync
+ Debug {
// Required methods
fn now_ms(&self) -> u64;
fn sleep(&self, duration: Duration) -> BoxFuture<'static, ()>;
// Provided method
fn supports_timers(&self) -> bool { ... }
}Expand description
Time source used by the engine and nodes (retries, timeouts, elapsed time).
Required Methods§
Provided Methods§
Sourcefn supports_timers(&self) -> bool
fn supports_timers(&self) -> bool
Whether Clock::sleep actually waits. Timeouts are only enforced when true.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Clock for NoTimerClock
impl Clock for TokioClock
Available on crate feature
tokio only.