pub struct ErrorLog {
pub timestamp: i64,
pub error_type: &'static str,
pub message: Cow<'static, str>,
pub context: SmallVec<[(&'static str, ErrorValue); 4]>,
pub stack_trace: Option<Cow<'static, str>>,
}Expand description
Structured error log entry optimized for performance
Fields§
§timestamp: i64§error_type: &'static str§message: Cow<'static, str>§context: SmallVec<[(&'static str, ErrorValue); 4]>§stack_trace: Option<Cow<'static, str>>Implementations§
Source§impl ErrorLog
impl ErrorLog
Sourcepub fn from_error(error: &P2PError) -> Self
pub fn from_error(error: &P2PError) -> Self
Creates an error log entry from a P2PError
pub fn with_context(self, key: &'static str, value: ErrorValue) -> Self
pub fn log(&self)
Trait Implementations§
Source§impl Deserialize<'static> for ErrorLog
impl Deserialize<'static> for ErrorLog
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'static>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'static>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ErrorLog
impl RefUnwindSafe for ErrorLog
impl Send for ErrorLog
impl Sync for ErrorLog
impl Unpin for ErrorLog
impl UnwindSafe for ErrorLog
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