Function zng_task::with_deadline

source ·
pub async fn with_deadline<O, F: Future<Output = O>>(
    fut: F,
    deadline: impl Into<Deadline>
) -> Result<F::Output, DeadlineError>
Expand description

Add a deadline to a future.

Returns the fut output or DeadlineError if the deadline elapses first.