twizzler_async

Function timeout_after

source
pub async fn timeout_after<F: Future>(f: F, dur: Duration) -> Option<F::Output>
Expand description

Await a future until a timeout occurs (or that future completes). If the timeout happens, return None, otherwise return Some of the result of the future. This timeout expires after a duration.