pub trait IntoTimeout: Future + Sized {
// Provided methods
fn timeout(self, timeout: Duration) -> Timeout<Self> ⓘ { ... }
fn deadline(self, deadline: Instant) -> Timeout<Self> ⓘ { ... }
}
Expand description
Futures implementing this trait can be constrained with a timeout (see
Timeout
).
NOTE: this trait is implemented for all type implementing
std::future::Future
, but it must be used only with futures from
crate::fiber::async
otherwise the behaviour is undefined.
Provided Methods§
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.