hyperlane/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(CustomDebug, Default, PartialEq, Eq, Clone, Getter, DisplayDebug)]
9pub struct Panic {
10    /// The message associated with the panic.
11    /// This is `None` if the panic payload is not a string.
12    #[get(pub)]
13    pub(super) message: OptionString,
14    /// The source code location where the panic occurred.
15    #[get(pub)]
16    pub(super) location: OptionString,
17    /// The payload of the panic, often a string literal.
18    /// The handler attempts to downcast it to a `&str` or `String`.
19    #[get(pub)]
20    pub(super) payload: OptionString,
21}