[][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

Important traits for MaybeUnwind<F>
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 _;

maybe_unwind::set_hook();

let res: Result<_, maybe_unwind::UnwindContext> = do_something_async()
    .maybe_unwind()
    .await;

maybe_unwind::reset_hook();
Loading content...

Implementors

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

Loading content...