pub async fn with_timeout<F, T>(
timeout: Duration,
operation: &str,
f: F,
) -> 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.