bffh/runtime/lightproc/src/proc_ext.rs

15 lines
325 B
Rust
Raw Permalink Normal View History

2021-11-14 17:50:59 +01:00
use crate::catch_unwind::CatchUnwind;
use std::future::Future;
use std::panic::UnwindSafe;
pub(crate) trait ProcFutureExt: Future {
fn catch_unwind(self) -> CatchUnwind<Self>
where
Self: Sized + UnwindSafe,
{
CatchUnwind::new(self)
}
}
impl<T: ?Sized> ProcFutureExt for T where T: Future {}