Skip to main content

TimeoutFutureExt

Trait TimeoutFutureExt 

Source
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§

Source

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".

Implementors§

Source§

impl<C> TimeoutFutureExt for C
where C: Future,