pub type ErrorCodeFormatter = fn(error_code: ErrorCode, next_formatter: Option<u8>, f: Option<&mut Formatter<'_>>) -> (ErrorCategoryHandle, Result<Option<ErrorCodeFormatterVal>, Error>);Expand description
A chained formatter function for a single error category.
A single ErrorCodeFormatter function is considered to be uniquely associated with a
type that implements ErrorCategory. Meaning one such function only ever returns the
ErrorCategoryHandle for that associated ErrorCategory, and never for another.
This function serves multiple purposes:
- If
fisSomethen this functions formatserror_codeusingf. - If
next_formatterisSome(index)then it returns the chained formatter of the associatedErrorCategoryindexed byindex. ASome(ErrorCodeFormatterVal)is returned ifindexis within bounds of the chainable categories (seeErrorCategory::chainable_category_formatters()). - This function additionally always returns a
ErrorCategoryHandlethat represents the associatedErrorCategory.