Skip to main content

Clock

Trait Clock 

Source
pub trait Clock:
    Send
    + Sync
    + 'static {
    // Required methods
    fn now(&self) -> Instant;
    fn sleep_until(&self, at: Instant) -> BoxFuture<'static, ()>;
}

Required Methods§

Source

fn now(&self) -> Instant

Source

fn sleep_until(&self, at: Instant) -> BoxFuture<'static, ()>

Resolves once now() >= at.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§