[−][src]Trait embedded_error_chain::ErrorCategory
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.
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.
Associated Constants
pub const NAME: &'static str
The text name of this category used for formatting.
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.