Skip to main content

ErrorContext

Trait ErrorContext 

Source
pub trait ErrorContext<T> {
    // Required methods
    fn context(self, context: impl Into<Cow<'static, str>>) -> RustealResult<T>;
    fn with_context<C, F>(self, context: F) -> RustealResult<T>
       where C: Into<Cow<'static, str>>,
             F: FnOnce() -> C;
}

Required Methods§

Source

fn context(self, context: impl Into<Cow<'static, str>>) -> RustealResult<T>

Source

fn with_context<C, F>(self, context: F) -> RustealResult<T>
where C: Into<Cow<'static, str>>, 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, E: Error + Send + Sync + 'static> ErrorContext<T> for Result<T, E>

Source§

fn context(self, context: impl Into<Cow<'static, str>>) -> RustealResult<T>

Source§

fn with_context<C, F>(self, context: F) -> RustealResult<T>
where C: Into<Cow<'static, str>>, F: FnOnce() -> C,

Source§

impl<T> ErrorContext<T> for Option<T>

Source§

fn context(self, context: impl Into<Cow<'static, str>>) -> RustealResult<T>

Source§

fn with_context<C, F>(self, context: F) -> RustealResult<T>
where C: Into<Cow<'static, str>>, F: FnOnce() -> C,

Implementors§