pub fn spawn_timeout<F>(
duration: Duration,
future: F,
) -> JoinHandle<Result<F::Output, TimeoutError>> ⓘExpand description
Spawns a new asynchronous task that must complete within duration.
If it does not, the future is dropped and the task completes with TimeoutError.