pub struct ErrorContext {
pub connection_id: Option<u64>,
pub remote_addr: Option<SocketAddr>,
pub operation: Option<String>,
pub context: HashMap<String, String>,
}Expand description
Error context for better error reporting
Fields§
§connection_id: Option<u64>Connection ID
remote_addr: Option<SocketAddr>Remote address
operation: Option<String>Operation being performed
context: HashMap<String, String>Additional context
Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub fn with_connection_id(self, id: u64) -> Self
pub fn with_connection_id(self, id: u64) -> Self
Set connection ID
Sourcepub fn with_remote_addr(self, addr: SocketAddr) -> Self
pub fn with_remote_addr(self, addr: SocketAddr) -> Self
Set remote address
Sourcepub fn with_operation(self, op: impl Into<String>) -> Self
pub fn with_operation(self, op: impl Into<String>) -> Self
Set operation
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