lightproc/proc_ext.rs
1use crate::catch_unwind::CatchUnwind;
2use std::future::Future;
3use std::panic::UnwindSafe;
4
5pub(crate) trait ProcFutureExt: Future {
6 fn catch_unwind(self) -> CatchUnwind<Self>
7 where
8 Self: Sized + UnwindSafe,
9 {
10 CatchUnwind::new(self)
11 }
12}
13
14impl<T: ?Sized> ProcFutureExt for T where T: Future {}