Skip to main content

Context

Trait Context 

Source
pub trait Context<T, E> {
    // Required method
    fn context<M: AlienErrorData + Clone + Debug + Serialize>(
        self,
        meta: M,
    ) -> Result<T, AlienError<M>>;
}
Expand description

Extension trait for adding context to AlienError Results

Required Methods§

Source

fn context<M: AlienErrorData + Clone + Debug + Serialize>( self, meta: M, ) -> Result<T, AlienError<M>>

Add context to an AlienError result, wrapping it with a new 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, E> for Result<T, AlienError<E>>
where E: AlienErrorData + Clone + Debug + Serialize + 'static + Send + Sync,

Source§

fn context<M: AlienErrorData + Clone + Debug + Serialize>( self, meta: M, ) -> Result<T, AlienError<M>>

Implementors§