Skip to main content

ContextExt

Trait ContextExt 

Source
pub trait ContextExt<T, E> {
    // Required methods
    fn with_io_context<S: Into<String>>(self, msg: S) -> Result<T>;
    fn with_parse_context<S: Into<String>>(self, msg: S) -> Result<T>;
}
Expand description

Extension trait for adding common context to results

Required Methods§

Source

fn with_io_context<S: Into<String>>(self, msg: S) -> Result<T>

Source

fn with_parse_context<S: Into<String>>(self, msg: S) -> Result<T>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T, E> ContextExt<T, E> for Result<T, E>
where E: Error + Send + Sync + 'static,

Source§

fn with_io_context<S: Into<String>>(self, msg: S) -> Result<T>

Source§

fn with_parse_context<S: Into<String>>(self, msg: S) -> Result<T>

Implementors§