Skip to main content

with_timeout

Function with_timeout 

Source
pub async fn with_timeout<F: Future>(
    fut: F,
    timeout: impl Future<Output = ()>,
) -> Option<F::Output>
Expand description

Run fut until it completes or timeout elapses first.

Returns None when timeout won the race.