pub fn timeout<F>(duration: Duration, future: F) -> Timeout<F> ⓘwhere F: Future,
time
Require a Future to complete before the specified duration has elapsed.
Future
If the future completes before the duration has elapsed, then the completed value is returned. Otherwise, an error is returned and the future is cancelled.
Panic if not running under a Runtime.
Runtime