pub fn timeout<F: Future>(duration: Duration, future: F) -> Timeout<F> ⓘExpand description
Runs future for at most duration: its output, or Elapsed if the
time ran out first. The future is polled before the clock is looked at,
so one that is ready at once always wins.