Trait async_executors::iface::TimerExt [−][src]
pub trait TimerExt: Timer {
fn timeout<F: Future>(&self, duration: Duration, future: F) -> Timeout<F>ⓘ { ... }
}
Expand description
An extension trait on Timer
for timeouts and clock delays.
Provided methods
Wrap a Future
with a timeout.
The output of the new future will be the returned value of
future
if it completes within duration
. Otherwise, it
will be Err(TimeoutError)
.
Limitations
This uses Timer::sleep
for its timer, and is
subject to the same limitations.