Skip to main content

run_within

Function run_within 

Source
pub async fn run_within<F>(
    limit: Duration,
    fut: F,
) -> Result<F::Output, Elapsed>
Expand description

Awaits fut, but gives up after limit.

Returns the future’s output if it finishes in time, or Elapsed if the limit is reached first. The runtime is selected at compile time by the enabled feature; with none enabled, the F: RuntimeAvailable bound is what turns a call into the RuntimeAvailable diagnostic.