pub trait Clock:
Send
+ Sync
+ Debug {
// Required methods
fn now(&self) -> Instant;
fn timestamp(&self) -> u64;
fn sleep(
&self,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>;
}Expand description
Trait for time operations including getting current time and async sleeping.
This trait abstracts time operations, allowing mock implementations for deterministic testing of time-dependent logic.