Struct panic_handler::AbortGuard[][src]

pub struct AbortGuard { /* fields omitted */ }
Expand description

RAII guard for whether panics in the current thread should unwind or abort.

Sets a thread-local abort flag on construction and reverts to the previous setting when dropped. Does not implement Send on purpose.

Note: Because we restore the previous value when dropped, you are encouraged to leave the AbortGuard on the stack and let it destroy itself naturally.

Implementations

Create a new guard. While the guard is alive, panics that happen in the current thread will unwind the stack (unless another guard is created afterwards).

Create a new guard. While the guard is alive, panics that happen in the current thread will abort the process (unless another guard is created afterwards).

Create a new guard. While the guard is alive, panics that happen in the current thread will never abort the process (even if AbortGuard::force_abort() guard will be created afterwards).

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.