Skip to main content

timeout

Function timeout 

Source
pub async fn timeout<T, F: Future<Output = T>>(
    dur: Duration,
    fut: F,
) -> Result<T, Elapsed>
Expand description

Run a future with a timeout. Returns Err(Elapsed) if the deadline passes before the future completes.