pub trait Clock {
type Instant: Instant;
// Required methods
fn wait_until(&self, time: Self::Instant) -> impl Future<Output = ()>;
fn now(&self) -> Self::Instant;
}Expand description
Provides access to system-time-related operations.
Required Associated Types§
Required Methods§
Sourcefn wait_until(&self, time: Self::Instant) -> impl Future<Output = ()>
fn wait_until(&self, time: Self::Instant) -> impl Future<Output = ()>
Completes once the monotonic system time is at or after the given time.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.