Skip to main content

ContextExt

Trait ContextExt 

Source
pub trait ContextExt<T> {
    // Required methods
    fn context<C>(self, context: C) -> Result<T, Error>
       where C: Into<String>;
    fn with_context<C, F>(self, f: F) -> Result<T, Error>
       where C: Into<String>,
             F: FnOnce() -> C;
}

Required Methods§

Source

fn context<C>(self, context: C) -> Result<T, Error>
where C: Into<String>,

Source

fn with_context<C, F>(self, f: F) -> Result<T, Error>
where C: Into<String>, F: FnOnce() -> C,

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> ContextExt<T> for Option<T>

Source§

fn context<C>(self, context: C) -> Result<T, Error>
where C: Into<String>,

Source§

fn with_context<C, F>(self, f: F) -> Result<T, Error>
where C: Into<String>, F: FnOnce() -> C,

Source§

impl<T> ContextExt<T> for Result<T, Error>

Source§

fn context<C>(self, context: C) -> Result<T, Error>
where C: Into<String>,

Source§

fn with_context<C, F>(self, f: F) -> Result<T, Error>
where C: Into<String>, F: FnOnce() -> C,

Implementors§