pub struct ErrorWithMetadata {
pub error: Box<dyn Error + Send + Sync>,
pub metadata: HashMap<String, String>,
}Expand description
Error with additional metadata for better debugging and error tracking.
This structure wraps any error and allows attaching key-value metadata that can be useful for logging, debugging, or displaying detailed error information to users.
Fields§
§error: Box<dyn Error + Send + Sync>The underlying error
metadata: HashMap<String, String>Additional metadata as key-value pairs
Implementations§
Trait Implementations§
Source§impl Debug for ErrorWithMetadata
impl Debug for ErrorWithMetadata
Source§impl Display for ErrorWithMetadata
impl Display for ErrorWithMetadata
Source§impl Error for ErrorWithMetadata
impl Error for ErrorWithMetadata
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ErrorWithMetadata
impl !RefUnwindSafe for ErrorWithMetadata
impl Send for ErrorWithMetadata
impl Sync for ErrorWithMetadata
impl Unpin for ErrorWithMetadata
impl UnsafeUnpin for ErrorWithMetadata
impl !UnwindSafe for ErrorWithMetadata
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