#[non_exhaustive]#[repr(u8)]pub enum FormatError {
UnresolvedVariable = 0,
UnknownFunction = 1,
BadSelector = 2,
BadOperand = 3,
BadOption = 4,
BadVariantKey = 5,
UnsupportedOperation = 6,
MessageFunctionError = 7,
MissingFallbackVariant = 8,
MissingMessage = 9,
Malformed = 10,
}Expand description
An error reported while formatting. Formatting still produces output.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnresolvedVariable = 0
Unresolved Variable: no value for a variable.
UnknownFunction = 1
Unknown Function: the registry has no handler for a function.
BadSelector = 2
Bad Selector: a selector’s value does not support selection.
BadOperand = 3
Bad Operand: a function cannot take its operand.
BadOption = 4
Bad Option: an option or its value is not valid for the function.
BadVariantKey = 5
Bad Variant Key: a key a selector cannot compare against.
UnsupportedOperation = 6
Unsupported Operation: valid, but not supported by this handler or configuration (or past an implementation limit).
MessageFunctionError = 7
Any other failure of a function handler.
MissingFallbackVariant = 8
No variant matched — only a catalog built from an invalid model (no
fallback variant, or key counts unlike the selector count) has one.
The message formats as {�}.
MissingMessage = 9
The id is not in this catalog. Nothing is written.
Malformed = 10
The message’s catalog record is malformed: {�} in its place, and
the message ends there.
Implementations§
Source§impl FormatError
impl FormatError
Sourcepub const fn kind(self) -> Option<ErrorKind>
pub const fn kind(self) -> Option<ErrorKind>
The MF2 error kind (mf2_model::ErrorKind); None for
FormatError::MissingMessage and FormatError::Malformed, which
are about the catalog, not the message.
Trait Implementations§
Source§impl Clone for FormatError
impl Clone for FormatError
impl Copy for FormatError
Source§impl Debug for FormatError
impl Debug for FormatError
Source§impl Display for FormatError
impl Display for FormatError
impl Eq for FormatError
Source§impl Error for FormatError
impl Error for FormatError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()