Skip to main content

ErrorContextExt

Trait ErrorContextExt 

Source
pub trait ErrorContextExt {
    type Output;

    // Required methods
    fn with_context(self, context: ErrorContext) -> Self::Output;
    fn with_file(self, file_path: PathBuf) -> Self::Output;
    fn with_line(self, line: usize) -> Self::Output;
    fn with_operation(self, operation: &str) -> Self::Output;
}
Expand description

Helper trait for adding context to errors

Required Associated Types§

Required Methods§

Source

fn with_context(self, context: ErrorContext) -> Self::Output

Add context to the error

Source

fn with_file(self, file_path: PathBuf) -> Self::Output

Add file path context

Source

fn with_line(self, line: usize) -> Self::Output

Add line context

Source

fn with_operation(self, operation: &str) -> Self::Output

Add operation context

Implementations on Foreign Types§

Source§

impl<T> ErrorContextExt for Result<T, ServiceError>

Source§

type Output = Result<T, ContextualError>

Source§

fn with_context(self, context: ErrorContext) -> Self::Output

Source§

fn with_file(self, file_path: PathBuf) -> Self::Output

Source§

fn with_line(self, line: usize) -> Self::Output

Source§

fn with_operation(self, operation: &str) -> Self::Output

Implementors§