[][src]Trait maybe_unwind::FutureMaybeUnwindExt

pub trait FutureMaybeUnwindExt: Future + Sized {
    fn maybe_unwind(self) -> MaybeUnwind<Self>
    where
        Self: UnwindSafe
, { ... } }

An extension trait for Futures that provides an adaptor for capturing the unwinding panic information.

Provided methods

fn maybe_unwind(self) -> MaybeUnwind<Self> where
    Self: UnwindSafe

Catches unwinding panics while polling the future.

This is a variant of catch_unwind that also captures the panic information.

Example

use maybe_unwind::FutureMaybeUnwindExt as _;

std::panic::set_hook(Box::new(|info| {
    maybe_unwind::capture_panic_info(info);
}));

let res = do_something_async().maybe_unwind().await;
Loading content...

Implementors

impl<F: Future> FutureMaybeUnwindExt for F[src]

Loading content...