pub struct ErrorContext {
pub error_type: String,
pub error_message: String,
pub component: String,
pub severity: String,
pub trace_id: Option<String>,
pub additional_context: Value,
}Expand description
Error context for detailed error logging
Fields§
§error_type: String§error_message: String§component: String§severity: String§trace_id: Option<String>§additional_context: ValueImplementations§
Source§impl ErrorContext
impl ErrorContext
pub fn new( error_type: impl ToString, error_message: impl ToString, component: impl ToString, ) -> Self
pub fn with_severity(self, severity: impl ToString) -> Self
pub fn with_trace_id(self, trace_id: impl ToString) -> Self
pub fn with_context(self, key: &str, value: Value) -> Self
pub fn log(&self)
Trait Implementations§
Source§impl Clone for ErrorContext
impl Clone for ErrorContext
Source§fn clone(&self) -> ErrorContext
fn clone(&self) -> ErrorContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorContext
impl Debug for ErrorContext
Auto Trait Implementations§
impl Freeze for ErrorContext
impl RefUnwindSafe for ErrorContext
impl Send for ErrorContext
impl Sync for ErrorContext
impl Unpin for ErrorContext
impl UnsafeUnpin for ErrorContext
impl UnwindSafe for ErrorContext
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