[][src]Function maybe_unwind::maybe_unwind

pub fn maybe_unwind<F, R>(f: F) -> Result<R, Unwind> where
    F: FnOnce() -> R + UnwindSafe

Invokes a closure, capturing the cause of an unwinding panic if one occurs.

In addition, this function also captures the panic information if the custom panic hook is set. If the panic hook is not set, only the cause of unwinding panic captured by catch_unwind is returned.