Skip to main content

WithContext

Trait WithContext 

Source
pub trait WithContext<T> {
    // Required method
    fn with_context(self, ctx: &str) -> Result<T>;
}
Expand description

Attach a context string to a Result, wrapping the error in a new General message that includes the original error’s display text.

Required Methods§

Source

fn with_context(self, ctx: &str) -> Result<T>

Wrap any error with an additional context prefix.

Implementations on Foreign Types§

Source§

impl<T, E: Display> WithContext<T> for Result<T, E>

Source§

fn with_context(self, ctx: &str) -> Result<T>

Implementors§