Clock

Trait Clock 

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

Abstraction for time.

Required Methods§

Source

fn sleep(&self, duration: Duration) -> BoxFuture<'static, ()>

Source

fn now(&self) -> Instant

Implementors§