Enum pfmt::FormattingError
source · pub enum FormattingError {
UnbalancedBrackets(usize),
EmptyNameSegment(usize),
EmptyOptionName(usize),
UnknownFlag(String, char),
UnknownOption(String, String),
InvalidOptionValue(String, String, String),
NamespaceOnlyFmt(String),
WrongNumberOfArguments(String, Ordering, usize),
InvalidArgument(String, usize, String),
UnknownFmt(String),
}
Expand description
Any error that can happen during formatting.
Variants
UnbalancedBrackets(usize)
Returned when the brackets in the format string are not balanced. Contains the byte address of the offending bracket.
EmptyNameSegment(usize)
Returned when a placeholder in the format string has an empty name segment. Contains the byte offset of the empty segment.
EmptyOptionName(usize)
Returned when a placeholder’s option has an empty name. Contains the byte offset of the place where the name should have been.
UnknownFlag(String, char)
A SingleFmtError::UnknownFlag
is propagated as this.
UnknownOption(String, String)
A SingleFmtError::UnknownOption
is propagated as this.
InvalidOptionValue(String, String, String)
A SingleFmtError::InvalidOptionValue
is propagated as this.
NamespaceOnlyFmt(String)
A SingleFmtError::NamespaceOnlyFmt
is propagated as this.
WrongNumberOfArguments(String, Ordering, usize)
A SingleFmtError::WrongNumberOfArguments
is propagated as this.
InvalidArgument(String, usize, String)
A SingleFmtError::InvalidArgument
is propagated as this.
UnknownFmt(String)
Returned when a requested Fmt
does not exist (or cannot be created)
in the format table. A SingleFmtError::UnknownSubfmt
is also
propagated as this. Contains the full path to the failed format unit.