Skip to main content

Context

Trait Context 

Source
pub trait Context<T> {
    // Required methods
    fn context(self, message: impl Into<String>) -> Result<T, Error>;
    fn with_context(self, message: impl FnOnce() -> String) -> Result<T, Error>;
}

Required Methods§

Source

fn context(self, message: impl Into<String>) -> Result<T, Error>

Source

fn with_context(self, message: impl FnOnce() -> String) -> Result<T, Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T, E> Context<T> for Result<T, E>
where E: Error + 'static,

Source§

fn context(self, message: impl Into<String>) -> Result<T, Error>

Source§

fn with_context(self, message: impl FnOnce() -> String) -> Result<T, Error>

Implementors§

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here