pub struct ErrorContext {
pub operation: String,
pub transport: Option<String>,
pub method: Option<String>,
pub component: Option<String>,
pub session_id: Option<String>,
pub extra: HashMap<String, Value>,
}Expand description
Extended error context for logging
Fields§
§operation: StringOperation being performed when error occurred
transport: Option<String>Transport type (stdio, http, websocket)
method: Option<String>Request method if applicable
component: Option<String>Client/server identifier
session_id: Option<String>Session or connection ID
extra: HashMap<String, Value>Additional context data
Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub fn with_transport(self, transport: impl Into<String>) -> Self
pub fn with_transport(self, transport: impl Into<String>) -> Self
Set transport type
Sourcepub fn with_method(self, method: impl Into<String>) -> Self
pub fn with_method(self, method: impl Into<String>) -> Self
Set method name
Sourcepub fn with_component(self, component: impl Into<String>) -> Self
pub fn with_component(self, component: impl Into<String>) -> Self
Set component identifier
Sourcepub fn with_session_id(self, session_id: impl Into<String>) -> Self
pub fn with_session_id(self, session_id: impl Into<String>) -> Self
Set session ID
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 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 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