[][src]Trait embedded_error_chain::ChainError

pub trait ChainError<O: ErrorCategory, Tag> {
    pub fn chain(self, error_code: O) -> Error<O>;
}

A trait that allows chaining of Error and DynError values and any value of a type that implements ErrorCategory.

Required methods

pub fn chain(self, error_code: O) -> Error<O>

Chain this error with the supplied error_code.

Panics

If the error category O is not linked with the ErrorCategory of the most recent error code, this function will panic.

Loading content...

Implementors

impl<C: ErrorCategory> ChainError<C, (L0, Concrete_t)> for C::L0[src]

impl<C: ErrorCategory> ChainError<C, (L0, Error_t)> for Error<C::L0>[src]

impl<C: ErrorCategory> ChainError<C, (L1, Concrete_t)> for C::L1[src]

impl<C: ErrorCategory> ChainError<C, (L1, Error_t)> for Error<C::L1>[src]

impl<C: ErrorCategory> ChainError<C, (L2, Concrete_t)> for C::L2[src]

impl<C: ErrorCategory> ChainError<C, (L2, Error_t)> for Error<C::L2>[src]

impl<C: ErrorCategory> ChainError<C, (L3, Concrete_t)> for C::L3[src]

impl<C: ErrorCategory> ChainError<C, (L3, Error_t)> for Error<C::L3>[src]

impl<C: ErrorCategory> ChainError<C, (L4, Concrete_t)> for C::L4[src]

impl<C: ErrorCategory> ChainError<C, (L4, Error_t)> for Error<C::L4>[src]

impl<C: ErrorCategory> ChainError<C, (L5, Concrete_t)> for C::L5[src]

impl<C: ErrorCategory> ChainError<C, (L5, Error_t)> for Error<C::L5>[src]

impl<O: ErrorCategory> ChainError<O, DynError> for DynError[src]

pub fn chain(self, error_code: O) -> Error<O>[src]

Chain a DynError with any error code of a linked ErrorCategory.

Note that this function has complexity O(n) where n is the length of the slice returned by O::chainable_category_formatters().

Panics

A call to this function panics if the slice of ErrorCodeFormatters returned by O::chainable_category_formatters() does not contain self.formatter().

Loading content...