Trait PanicInfoExt

Source
pub trait PanicInfoExt<'a> {
    // Required method
    fn panic_message(&'a self) -> impl Message + 'a;

    // Provided method
    fn panic_details(&'a self) -> PanicDetails<'a, impl Message + 'a> { ... }
}
Expand description

Extension trait to provide better API for PanicInfo

Required Methods§

Source

fn panic_message(&'a self) -> impl Message + 'a

Retrieves underlying panic message

Provided Methods§

Source

fn panic_details(&'a self) -> PanicDetails<'a, impl Message + 'a>

Access uniform details of panic

Default implementation uses location of this function call. When panic location is known, it is overridden with specialized version

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a> PanicInfoExt<'a> for &'a (dyn Any + Send + 'static)

Source§

fn panic_message(&'a self) -> impl Message + 'a

Source§

impl<'a> PanicInfoExt<'a> for PanicInfo<'a>

Source§

fn panic_message(&'a self) -> impl Message + 'a

Source§

fn panic_details(&'a self) -> PanicDetails<'a, impl Message + 'a>

Implementors§