Trait Time

Source
pub trait Time: Clone + Debug {
    // Required 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;
    fn elapsed(&self, start: Instant) -> Duration;
}

Required Methods§

Source

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

Source

fn elapsed(&self, start: Instant) -> Duration

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.

Implementors§