Skip to main content

ContextExt

Trait ContextExt 

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

Required Methods§

Source

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

Source

fn with_context<C: Into<String>, F: FnOnce() -> C>(self, f: F) -> 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> ContextExt<T> for Option<T>

Source§

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

Source§

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

Implementors§

Source§

impl<T> ContextExt<T> for Result<T>