Trait PanicPayload

pub trait PanicPayload: Display

An internal trait used by std to pass data from std to panic_unwind and other panic runtimes. Not intended to be stabilized any time soon, do not use.

Required Methods

fn take_box(&mut self) -> Box<dyn Any + Send>

Take full ownership of the contents.

After this method got called, only some dummy default value is left in self. Calling this method twice, or calling get after calling this method, is an error.

The argument is borrowed because the panic runtime (__rust_start_panic) only gets a borrowed dyn PanicPayload.

fn get(&mut self) -> &dyn Any + Send

Just borrow the contents.

Provided Methods

fn as_str(&mut self) -> Option<&str>

Tries to borrow the contents as &str, if possible without doing any allocations.