doc.rust-lang.org
pub struct Components<'a>
An iterator over the Components of a Path.
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_os_str(self) -> &'a OsStr
Extracts the underlying OsStr slice.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub enum Component<'a>
A single component of a path.
enum
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Ancestors<'a>
An iterator over Path and its ancestors.
struct
std
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod path
Cross-platform path manipulation.
module
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn take_hook() -> Box<dyn Fn(&crate::panic::PanicHookInfo<'_>) + Sync + Send + 'static>
Unregisters the current panic hook and returns it, registering the default hook in its place.
function
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn set_hook(hook: Box<dyn Fn(&crate::panic::PanicHookInfo<'_>) + Sync + Send + 'static>)
Registers a custom panic hook, replacing the previously registered hook.
function
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn resume_unwind(payload: Box<dyn Any + Send>) -> never
This is the entry point for resume_unwind. It just forwards the payload to the panic runtime.
function
std
Version 1.100.0-nightly
doc.rust-lang.org
pub fn panicking() -> bool
Determines whether the current thread is unwinding because of panic.
function
std
Version 1.100.0-nightly
doc.rust-lang.org
pub fn panic_handler(info: &core::panic::PanicInfo<'_>) -> never
Entry point of panics from the core crate (panic_impl lang item).
function
std
Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn catch_unwind<R, F>(f: F) -> Result<R, Box<dyn Any + Send>>
Invoke a closure, capturing the cause of an unwinding panic if one occurs.
function
std
Version 1.100.0-nightly
doc.rust-lang.org
pub fn resume_unwind(payload: Box<dyn Any + Send>) -> never
Triggers a panic without invoking the panic hook.
function
std
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn panic_any<M>(msg: M) -> never
Panics the current thread with the given message as the panic payload.
function
std
Stable since 1.51.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn catch_unwind<F, R>(f: F) -> crate::thread::Result<R>
Invokes a closure, capturing the cause of an unwinding panic if one occurs.
function
std
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub type PanicInfo<'a> = PanicHookInfo<'a>
A struct providing information about a panic.
type_alias
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn payload_as_str(&self) -> Option<&str>
Returns the payload associated with the panic, if it is a string.
method
std
Stable since 1.91.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn payload(&self) -> &dyn Any + Send
Returns the payload associated with the panic.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn location(&self) -> Option<&'static Location<'static>>
Returns information about the location from which the panic originated, if available.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct PanicHookInfo<'a>
A struct providing information about a panic.
struct
std
Stable since 1.81.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod panic
Panic support in the standard library.
module
std
Stable since 1.9.0
Version 1.100.0-nightly