Crate catch_unwind

Source
Expand description

This crate provides wrappers for std::panic::catch_unwind that handle the edge case of the caught panic payload itself panicing when dropped.

Structs§

Payload
Unwinding payload wrapped to abort by default if it panics on drop

Functions§

catch_unwind_or_abort
Invoke the provided closure and catch any unwinding panics that may occur. If the panic payload panics when dropped, abort the process.
catch_unwind_or_forget
Invoke the provided closure and catch any unwinding panics that may occur. If the panic payload panics when dropped, mem::forget the new panic payload and return None.
catch_unwind_wrapped
Invoke the provided closure and catch any unwinding panics that may occur. This wraps the unwinding payload in Payload, which will abort if it panics on drop by default. You can use the methods of Payload to change this behaviour.
drop_or_abort
Drop a value. If dropping the value results in an unwinding panic, abort the process.
drop_or_else
Drop a value. If dropping the value results in an unwinding panic, call the provided closure with the panic payload.
drop_or_forget
Drop a value. If dropping the value results in an unwinding panic, mem::forget the panic payload.