Skip to main content

TimeoutExt

Trait TimeoutExt 

Source
pub trait TimeoutExt: IntoFuture + Sized {
    // Provided method
    fn within(self, timeout: Duration) -> impl Future<Output = Self::Output> { ... }
}
Expand description

Bound how long a test is willing to wait on a future

Provided Methods§

Source

fn within(self, timeout: Duration) -> impl Future<Output = Self::Output>

Await self, panicking if it doesn’t complete within timeout

The panic message points at the caller, so that a hung test reports what it was waiting on instead of stalling CI.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§