#[doc(hidden)] pub unsafe trait PanicPayload: Display {
// Required methods
fn take_box(&mut self) -> *mut dyn Any + Send;
fn get(&mut self) -> &(dyn Any + Send);
// Provided method
fn as_str(&mut self) -> Option<&str> { ... }
}🔬This is a nightly-only experimental API. (
std_internals)Expand description
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§
Sourcefn take_box(&mut self) -> *mut dyn Any + Send
🔬This is a nightly-only experimental API. (std_internals)
fn take_box(&mut self) -> *mut dyn Any + Send
std_internals)Take full ownership of the contents.
The return type is actually Box<dyn Any + Send>, but we cannot use Box in core.
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.