pub fn catch_unwind_future<F: Future>(
fut: F,
) -> impl Future<Output = Result<F::Output, Box<dyn Any + Send>>>Expand description
catch_unwind for futures (std has no FutureExt::catch_unwind):
each poll of fut runs under catch_unwind, so a panic raised at any
await point inside fut surfaces as Err instead of unwinding the
loop task.