Skip to main content

Context

Trait Context 

Source
pub trait Context<T> {
    // Required methods
    fn context(self, err: impl Into<VantageError>) -> Result<T, VantageError>;
    fn with_context<F>(self, f: F) -> Result<T, VantageError>
       where F: FnOnce() -> VantageError;
}
Expand description

Trait for adding context to Results

Required Methods§

Source

fn context(self, err: impl Into<VantageError>) -> Result<T, VantageError>

Source

fn with_context<F>(self, f: F) -> Result<T, VantageError>
where F: FnOnce() -> VantageError,

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 + Send + Sync + 'static,

Source§

fn context(self, err: impl Into<VantageError>) -> Result<T, VantageError>

Source§

fn with_context<F>(self, f: F) -> Result<T, VantageError>
where F: FnOnce() -> VantageError,

Implementors§