pub async fn timeout<F: Future>( duration: Duration, future: F, ) -> Result<F::Output, ()>
Run future, giving up after duration.
future
duration
Err(()) means the deadline passed; the future is dropped at that point.
Err(())