pub async fn timeout<F: Future>( duration: Duration, future: F, ) -> Result<F::Output, Elapsed>
Bound future by duration using the active platform runtime.
future
duration