compio_runtime::time

Function timeout_at

Source
pub async fn timeout_at<F: Future>(
    deadline: Instant,
    future: F,
) -> Result<F::Output, Elapsed>
Available on crate feature time only.
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.