pub struct ErrorContext {
pub category: String,
pub operation: String,
pub request_id: Option<String>,
pub client_id: Option<String>,
pub metadata: HashMap<String, String>,
}Expand description
Error context for detailed error reporting
Fields§
§category: StringError category
operation: StringOperation being performed
request_id: Option<String>Request ID if applicable
client_id: Option<String>Client ID if applicable
metadata: HashMap<String, String>Additional metadata
Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub fn new(category: impl Into<String>, operation: impl Into<String>) -> Self
pub fn new(category: impl Into<String>, operation: impl Into<String>) -> Self
Create a new error context
Sourcepub fn with_request_id(self, request_id: impl Into<String>) -> Self
pub fn with_request_id(self, request_id: impl Into<String>) -> Self
Add request ID to context
Sourcepub fn with_client_id(self, client_id: impl Into<String>) -> Self
pub fn with_client_id(self, client_id: impl Into<String>) -> Self
Add client ID to context
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ErrorContext
impl RefUnwindSafe for ErrorContext
impl Send for ErrorContext
impl Sync for ErrorContext
impl Unpin 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