pub fn timeout<T, U>(dur: U, future: T) -> Timeout<T> ⓘExpand description
Requires a future to complete before dur has elapsed.
If the future completes before the duration has elapsed, then the completed
value is returned. Otherwise, an error is returned and the future is
canceled. A zero duration still represents an active timeout of at least
one timer tick; use timeout_checked to disable the timeout with zero.