[][src]Trait embedded_error_chain::ErrorCategory

pub trait ErrorCategory: Copy + Into<ErrorCode> + From<ErrorCode> + Debug {
    type L0: ErrorCategory;
    type L1: ErrorCategory;
    type L2: ErrorCategory;
    type L3: ErrorCategory;
    type L4: ErrorCategory;
    type L5: ErrorCategory;

    pub const NAME: &'static str;
    pub fn chainable_category_formatters() -> &'static [ErrorCodeFormatter] { ... }
}

A trait that implements the logic for debug printing and ErrorCode conversion. It also specifies the links to other error categories that allows errors of different categories to be chained.

Note: Only up to 6 linked error categories are supported.

See Error, DynError and ErrorData for more information.

Associated Types

type L0: ErrorCategory

Type of linked error category 0.

Set to Unused if unused.

type L1: ErrorCategory

Type of linked error category 1.

Set to Unused if unused.

type L2: ErrorCategory

Type of linked error category 2.

Set to Unused if unused.

type L3: ErrorCategory

Type of linked error category 3.

Set to Unused if unused.

type L4: ErrorCategory

Type of linked error category 4.

Set to Unused if unused.

type L5: ErrorCategory

Type of linked error category 5.

Set to Unused if unused.

Loading content...

Associated Constants

pub const NAME: &'static str

The text name of this category used for formatting.

Loading content...

Provided methods

pub fn chainable_category_formatters() -> &'static [ErrorCodeFormatter]

Get a slice of all ErrorCodeFormatter functions for all error categories that this error category is linked to.

Specifically returns a slice of function pointers to the error code formatter function of Self::L0 up to Self::L5. Each element in the returned slice corresponds to the formatter function of the error category type Self::Lx where x is the index of the element. The slice can be smaller than 6 elements, if the excluded linked error categories are unused (i.e. Self::Lx is set to Unused).

All formatter functions contained in the returned slice must have identical behavior to format_chained() with the exception that the formatting can differ.

Loading content...

Implementors

impl ErrorCategory for Unused[src]

type L0 = Unused

type L1 = Unused

type L2 = Unused

type L3 = Unused

type L4 = Unused

type L5 = Unused

Loading content...