http_type/panic/struct.rs
1use crate::*;
2
3/// Represents detailed information about a panic that has occurred within the server.
4///
5/// This struct captures essential details about a panic, such as the message,
6/// source code location, and payload. It is used by the server's panic handling
7/// mechanism and passed to the configured panic hook for custom processing.
8#[derive(
9 Clone, CustomDebug, Default, Deserialize, DisplayDebug, Eq, Getter, PartialEq, Serialize, New,
10)]
11pub struct PanicData {
12 /// The message associated with the panic.
13 /// This is `None` if the panic payload is not a string.
14 pub(super) message: Option<String>,
15 /// The source code location where the panic occurred.
16 pub(super) location: Option<String>,
17 /// The payload of the panic, often a string literal.
18 /// The hook attempts to downcast it to a `&str` or `String`.
19 pub(super) payload: Option<String>,
20}