pub struct ErrorContext {
pub source_location: Option<(String, u32)>,
pub context: Vec<(String, String)>,
pub cause: Option<Box<FugueError>>,
}Expand description
Enhanced error context providing debugging information.
Fields§
§source_location: Option<(String, u32)>Optional source location (file, line) where error occurred
context: Vec<(String, String)>Additional contextual information
cause: Option<Box<FugueError>>Chain of causality (parent errors)
Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub fn with_context(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_context( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add contextual key-value information.
Sourcepub fn with_source_location(self, file: impl Into<String>, line: u32) -> Self
pub fn with_source_location(self, file: impl Into<String>, line: u32) -> Self
Add source location information.
Sourcepub fn with_cause(self, cause: FugueError) -> Self
pub fn with_cause(self, cause: FugueError) -> Self
Chain another error as the cause.
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