Skip to main content

timeout

Function timeout 

Source
pub async fn timeout<F: Future>(
    duration: Duration,
    future: F,
) -> Result<F::Output, ()>
Expand description

Run future, giving up after duration.

Err(()) means the deadline passed; the future is dropped at that point.