pub struct PanicData { /* private fields */ }Expand description
Represents detailed information about a panic that has occurred within the server.
This struct captures essential details about a panic, such as the message, source code location, and payload. It is used by the server’s panic handling mechanism and passed to the configured panic hook for custom processing.
Implementations§
Source§impl PanicData
Implementation of methods for the PanicData struct.
impl PanicData
Implementation of methods for the PanicData struct.
Sourcepub fn from_join_error(join_error: JoinError) -> Self
pub fn from_join_error(join_error: JoinError) -> Self
Creates a PanicData instance from a tokio::task::JoinError.
This is used to handle panics that occur within spawned asynchronous tasks,
extracting the panic message from the JoinError.
§Arguments
JoinError- The error from a panicked task.
§Returns
PanicData- A new panic instance with message from error.
Source§impl PanicData
impl PanicData
pub fn get_message(&self) -> String
pub fn try_get_message(&self) -> &Option<String>
pub fn get_location(&self) -> String
pub fn try_get_location(&self) -> &Option<String>
pub fn get_payload(&self) -> String
pub fn try_get_payload(&self) -> &Option<String>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PanicData
impl<'de> Deserialize<'de> for PanicData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PanicData
impl StructuralPartialEq for PanicData
Auto Trait Implementations§
impl Freeze for PanicData
impl RefUnwindSafe for PanicData
impl Send for PanicData
impl Sync for PanicData
impl Unpin for PanicData
impl UnsafeUnpin for PanicData
impl UnwindSafe for PanicData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more