pub async fn timeout<F: IntoFuture>( duration: Option<Duration>, f: F, ) -> Result<F::Output, Elapsed>
Requires a Future to complete before the specified duration has elapsed.
Future