trait Clock: Send + Sync {
// Required methods
fn now(&self) -> Instant;
fn sleep(
&self,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send>>;
}Expand description
The source of time for the identification budget and the rate limit backoff.
Tests replace it to drive time by hand.
Required Methods§
fn now(&self) -> Instant
fn sleep(&self, duration: Duration) -> Pin<Box<dyn Future<Output = ()> + Send>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".