AsyncTimerExt

Trait AsyncTimerExt 

Source
pub trait AsyncTimerExt {
    // Required methods
    fn start_async(&self) -> AsyncTimerGuard<'_>;
    fn time_async<F, Fut, T>(&self, f: F) -> TimedFuture<'_, Fut>
       where F: FnOnce() -> Fut,
             Fut: Future<Output = T>;
}
Expand description

Extension trait for async timer operations

Required Methods§

Source

fn start_async(&self) -> AsyncTimerGuard<'_>

Start an async-aware timer

Source

fn time_async<F, Fut, T>(&self, f: F) -> TimedFuture<'_, Fut>
where F: FnOnce() -> Fut, Fut: Future<Output = T>,

Time an async function

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§