Skip to main content

with_timeout

Function with_timeout 

Source
pub async fn with_timeout<F, T>(
    timeout: Duration,
    operation: &str,
    f: F,
) -> Result<T, Error>
where F: Future<Output = Result<T, Error>>,
Expand description

Run f with a timeout. Returns Error::Timeout if the future does not complete within timeout.

ยงErrors

Returns Error::Timeout if the future exceeds the deadline, or propagates whatever error f itself returns.