pub async fn with_timeout<F, T>(
future: F,
duration: Duration,
) -> Result<T, TimeoutError>where
F: Future<Output = T>,Expand description
Runs the provided future and resolves with TimeoutError if it does not complete
within the specified duration.