Context

Trait Context 

Source
pub trait Context<T, E> {
    // Required methods
    fn context<C>(self, context: C) -> Result<T>
       where C: Display + Send + Sync + 'static;
    fn with_context<C, F>(self, context: F) -> Result<T>
       where C: Display + Send + Sync + 'static,
             F: FnOnce() -> C;
    fn dot(self) -> Result<T>;
}

Required Methods§

Source

fn context<C>(self, context: C) -> Result<T>
where C: Display + Send + Sync + 'static,

Source

fn with_context<C, F>(self, context: F) -> Result<T>
where C: Display + Send + Sync + 'static, F: FnOnce() -> C,

Source

fn dot(self) -> Result<T>

like google map red dot, only record the location info without any context message.

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> Context<T, Infallible> for Option<T>
where Option<T>: Context<T, Infallible>,

Source§

fn context<C>(self, context: C) -> Result<T, Error>
where C: Display + Send + Sync + 'static,

Source§

fn with_context<C, F>(self, context: F) -> Result<T, Error>
where C: Display + Send + Sync + 'static, F: FnOnce() -> C,

Source§

fn dot(self) -> Result<T>

Implementors§

Source§

impl<T, E> Context<T, E> for Result<T, E>
where E: Display, Result<T, E>: Context<T, E>,