Skip to main content

Module panic

Module panic 

1.9.0 Β· Source
Expand description

Panic support in the standard library.

Re-exportsΒ§

use crate::any::Any; πŸ”’
use crate::sync::atomic::Atomic; πŸ”’ Experimental
use crate::sync::atomic::AtomicU8; πŸ”’
use crate::sync::atomic::Ordering; πŸ”’
use crate::sync::Condvar; πŸ”’
use crate::sync::Mutex; πŸ”’
use crate::sync::RwLock; πŸ”’
use crate::thread::Result; πŸ”’
use crate::collections; πŸ”’
use crate::fmt; πŸ”’
use crate::panicking; πŸ”’
pub use crate::panicking::set_hook;
pub use crate::panicking::take_hook;
pub use core::panic::panic_2021; πŸ‘» Experimental
pub use crate::panicking::update_hook;Experimental

MacrosΒ§

panic_2015 πŸ‘» Experimental

StructsΒ§

AssertUnwindSafe
A simple wrapper around a type to assert that it is unwind safe.
Location
A struct containing information about the location of a panic.
PanicHookInfo
A struct providing information about a panic.

EnumsΒ§

BacktraceStyleExperimental
The configuration for whether and how the default panic hook will capture and display the backtrace.

StaticsΒ§

SHOULD_CAPTURE πŸ”’

TraitsΒ§

RefUnwindSafe
A marker trait representing types where a shared reference is considered unwind safe.
UnwindSafe
A marker trait which represents β€œpanic safe” types in Rust.

FunctionsΒ§

catch_unwind
Invokes a closure, capturing the cause of an unwinding panic if one occurs.
panic_any
Panics the current thread with the given message as the panic payload.
resume_unwind
Triggers a panic without invoking the panic hook.
abort_on_unwindExperimental
Invokes a closure, aborting if the closure unwinds.
always_abortExperimental
Makes all future panics abort directly without running the panic hook or unwinding.
get_backtrace_styleExperimental
Checks whether the standard library’s panic hook will capture and print a backtrace.
set_backtrace_styleExperimental
Configures whether the default panic hook will capture and display a backtrace.

Type AliasesΒ§

PanicInfoDeprecated
A struct providing information about a panic.