Clock

Trait Clock 

pub trait Clock:
    Send
    + Sync
    + Debug
    + 'static {
    // Required methods
    fn now_ns(&self) -> i64;
    fn sleep_until<'life0, 'async_trait>(
        &'life0 self,
        deadline_ns: i64,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn sleep<'life0, 'async_trait>(
        &'life0 self,
        duration: Duration,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}

Required Methods§

fn now_ns(&self) -> i64

fn sleep_until<'life0, 'async_trait>( &'life0 self, deadline_ns: i64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

fn sleep<'life0, 'async_trait>( &'life0 self, duration: Duration, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§