PanicMessage in core::panic - Rust (original) (raw)

Struct PanicMessage

1.81.0 · Source

pub struct PanicMessage<'a> { /* private fields */ }

Expand description

A message that was given to the panic!() macro.

The Display implementation of this type will format the message with the arguments that were given to the panic!() macro.

See PanicInfo::message.

Source§

1.81.0 (const: 1.84.0) · Source

Gets the formatted message, if it has no arguments to be formatted at runtime.

This can be used to avoid allocations in some cases.

§Guarantees

For panic!("just a literal"), this function is guaranteed to return Some("just a literal").

For most cases with placeholders, this function will return None.

See fmt::Arguments::as_str for details.

§

§

§

§

§

§