Trait TimeoutExt

Source
pub trait TimeoutExt: Sized {
    // Provided method
    fn timeout(self, duration: Duration) -> Timeout<Self>  { ... }
}

Provided Methods§

Source

fn timeout(self, duration: Duration) -> Timeout<Self>

Requires a Future or Stream to complete before the specific duration has elapsed.

Note: If a Stream returns an item, the timer will reset until Poll::Ready(None) is returned

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.

Implementors§

Source§

impl<T: Sized> TimeoutExt for T