pub trait TimeoutFutureExt: Sized {
// Required method
fn with_timeout(self, delay: Duration) -> PreemptibleFuture<Sleep, Self> ⓘ;
}Expand description
Extension trait to allow wrapping futures such that they can time out
Kinda like tokio::time::timeout but postfix
Required Methods§
Sourcefn with_timeout(self, delay: Duration) -> PreemptibleFuture<Sleep, Self> ⓘ
fn with_timeout(self, delay: Duration) -> PreemptibleFuture<Sleep, Self> ⓘ
Wrap a future so that it can be preempted by a timeout
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".