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;
const NAME: &'static str;
// Provided method
fn chainable_category_formatters() -> &'static [ErrorCodeFormatter] { ... }
}Expand description
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.
Required Associated Constants§
Required Associated Types§
Sourcetype L0: ErrorCategory
type L0: ErrorCategory
Type of linked error category 0.
Set to Unused if unused.
Sourcetype L1: ErrorCategory
type L1: ErrorCategory
Type of linked error category 1.
Set to Unused if unused.
Sourcetype L2: ErrorCategory
type L2: ErrorCategory
Type of linked error category 2.
Set to Unused if unused.
Sourcetype L3: ErrorCategory
type L3: ErrorCategory
Type of linked error category 3.
Set to Unused if unused.
Sourcetype L4: ErrorCategory
type L4: ErrorCategory
Type of linked error category 4.
Set to Unused if unused.
Sourcetype L5: ErrorCategory
type L5: ErrorCategory
Type of linked error category 5.
Set to Unused if unused.
Provided Methods§
Sourcefn chainable_category_formatters() -> &'static [ErrorCodeFormatter]
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".