pub async fn timeout<F, T>(duration: Duration, future: F) -> Result<T>where F: Future<Output = T>, T: Send + 'static,
If the future completes before the duration has elapsed, then the completed value is returned. Otherwise, an error is returned and the future is canceled.