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§
Sourcefn start_async(&self) -> AsyncTimerGuard<'_>
fn start_async(&self) -> AsyncTimerGuard<'_>
Start an async-aware timer
Sourcefn time_async<F, Fut, T>(&self, f: F) -> TimedFuture<'_, Fut>
fn time_async<F, Fut, T>(&self, f: F) -> TimedFuture<'_, Fut>
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.