Trait BoxedResultExt

Source
pub trait BoxedResultExt<T, E: ?Sized>: BoxedResultSealed {
    // Required methods
    fn context<M>(self, msg: M) -> Result<T, BoxContext<M, E>>
       where M: Display;
    fn with_context<F, M>(self, f: F) -> Result<T, BoxContext<M, E>>
       where F: FnOnce(&Box<E>) -> M,
             M: Display;
}
Expand description

A ResultExt equivalent for boxed errors.

This trait serves the same purpose and acts in the same ways as the ResultExt, so refer to that for details. It exists merely for implementation purposes.

Required Methods§

Source

fn context<M>(self, msg: M) -> Result<T, BoxContext<M, E>>
where M: Display,

A ResultExt::context equivalent.

Source

fn with_context<F, M>(self, f: F) -> Result<T, BoxContext<M, E>>
where F: FnOnce(&Box<E>) -> M, M: Display,

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> BoxedResultExt<T, dyn Error + Send + Sync> for Result<T, Box<dyn Error + Send + Sync>>

Source§

fn context<M>(self, msg: M) -> Result<T, BoxContext<M, dyn Error + Send + Sync>>
where M: Display,

Source§

fn with_context<F, M>( self, f: F, ) -> Result<T, BoxContext<M, dyn Error + Send + Sync>>
where F: FnOnce(&Box<dyn Error + Send + Sync>) -> M, M: Display,

Source§

impl<T> BoxedResultExt<T, dyn Error + Send> for Result<T, Box<dyn Error + Send>>

Source§

fn context<M>(self, msg: M) -> Result<T, BoxContext<M, dyn Error + Send>>
where M: Display,

Source§

fn with_context<F, M>(self, f: F) -> Result<T, BoxContext<M, dyn Error + Send>>
where F: FnOnce(&Box<dyn Error + Send>) -> M, M: Display,

Source§

impl<T> BoxedResultExt<T, dyn Error + Sync> for Result<T, Box<dyn Error + Sync>>

Source§

fn context<M>(self, msg: M) -> Result<T, BoxContext<M, dyn Error + Sync>>
where M: Display,

Source§

fn with_context<F, M>(self, f: F) -> Result<T, BoxContext<M, dyn Error + Sync>>
where F: FnOnce(&Box<dyn Error + Sync>) -> M, M: Display,

Source§

impl<T> BoxedResultExt<T, dyn Error> for Result<T, Box<dyn Error>>

Source§

fn context<M>(self, msg: M) -> Result<T, BoxContext<M, dyn Error>>
where M: Display,

Source§

fn with_context<F, M>(self, f: F) -> Result<T, BoxContext<M, dyn Error>>
where F: FnOnce(&Box<dyn Error>) -> M, M: Display,

Implementors§