Skip to main content

ErrorContext

Trait ErrorContext 

Source
pub trait ErrorContext<T> {
    // Required method
    fn context(self, span: Span) -> Result<T, Error>;
}
Expand description

Attach a source span to an error.

Required Methods§

Source

fn context(self, span: Span) -> Result<T, Error>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T, E: ToString> ErrorContext<T> for Result<T, E>

Source§

fn context(self, span: Span) -> Result<T, Error>

Implementors§