Function timeout_at

Source
pub fn timeout_at<T>(deadline: Instant, future: T) -> Timeout<T> 
where T: Future,
Expand description

Require a Future to complete before the specified instant in time.

If the future completes before the instant is reached, then the completed value is returned. Otherwise, an error is returned.

§Cancelation

Cancelling a timeout is done by dropping the future. No additional cleanup or other work is required.

The original future may be obtained by calling Timeout::into_inner. This consumes the Timeout.