Skip to main content

ErrorExt

Trait ErrorExt 

Source
pub trait ErrorExt: Sized {
    type Result<E>;
    type S: State + ?Sized;

    // Required methods
    fn build_error(self) -> Self::Result<Error<Self::S>>;
    fn erase_error(self) -> Self::Result<impl Error + Send + Sync + 'static>;
}
Expand description

Extension trait for materializing or erasing an error.

Required Associated Types§

Required Methods§

Source

fn build_error(self) -> Self::Result<Error<Self::S>>

Materializes the final Error<Self::S>.

Source

fn erase_error(self) -> Self::Result<impl Error + Send + Sync + 'static>

Materializes and then erases the state, returning an opaque impl Error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T, E1, S, F, L> ErrorExt for Result<T, Builder<E1, S, F, L>>
where E1: Error + Send + Sync + 'static, F: PayloadFn, S: State + ?Sized, L: Context + ?Sized,

Source§

type Result<E> = Result<T, E>

Source§

type S = S

Source§

fn build_error(self) -> Self::Result<Error<Self::S>>

Source§

fn erase_error(self) -> Self::Result<impl Error + Send + Sync + 'static>

Source§

impl<T, E1> ErrorExt for Result<T, E1>
where E1: Error + Send + Sync + 'static,

Source§

type Result<E> = Result<T, E>

Source§

type S = Stateless

Source§

fn build_error(self) -> Self::Result<Error<Self::S>>

Source§

fn erase_error(self) -> Self::Result<impl Error + Send + Sync + 'static>

Source§

impl<T, S1, S, F, L> ErrorExt for Result<T, Builder<Error<S1>, S, F, L>>
where S1: State + ?Sized, F: PayloadFn, S: State + ?Sized, L: Context + ?Sized,

Source§

type Result<E> = Result<T, E>

Source§

type S = S

Source§

fn build_error(self) -> Self::Result<Error<Self::S>>

Source§

fn erase_error(self) -> Self::Result<impl Error + Send + Sync + 'static>

Source§

impl<T, S> ErrorExt for Result<T, Error<S>>
where S: State + ?Sized,

Source§

type Result<E> = Result<T, E>

Source§

type S = S

Source§

fn build_error(self) -> Self::Result<Error<Self::S>>

Source§

fn erase_error(self) -> Self::Result<impl Error + Send + Sync + 'static>

Implementors§

Source§

impl<E1, S, F, L> ErrorExt for Builder<E1, S, F, L>
where E1: Error + Send + Sync + 'static, F: PayloadFn, S: State + ?Sized, L: Context + ?Sized,

Source§

type Result<E> = E

Source§

type S = S

Source§

impl<S1, S, F, L> ErrorExt for Builder<Error<S1>, S, F, L>
where S1: State + ?Sized, F: PayloadFn, S: State + ?Sized, L: Context + ?Sized,

Source§

type Result<E> = E

Source§

type S = S

Source§

impl<S> ErrorExt for Error<S>
where S: State + ?Sized,

Source§

type Result<E> = E

Source§

type S = S