Enum pfmt::SingleFmtError
source · pub enum SingleFmtError {
UnknownFlag(String, char),
UnknownOption(String, String),
InvalidOptionValue(String, String, String),
NamespaceOnlyFmt(String),
UnknownSubfmt(String),
WrongNumberOfArguments(String, Ordering, usize),
InvalidArgument(String, usize, String),
}
Expand description
Errors that happen in individual Fmt
s. All of them contain the full path
to the Fmt
in error as the first field.
Variants
UnknownFlag(String, char)
Returned if a Fmt
receives a flag it doesn’t know how to handle.
It’s not actually used by the impl
s for the standard types, but you
can use it if you wish to be strict. Contains the erroneous flag.
UnknownOption(String, String)
Returned if a Fmt
receives an option it doesn’t know how to handle.
Again, standard types do not do this, they are not strict. Contains the
erroneous option.
InvalidOptionValue(String, String, String)
Returned when a given option (stored in the first field) contains an invalid value (stored in the second field). Standard types do use this. Contains a pair of erroneous option’s name and value.
NamespaceOnlyFmt(String)
Returned when a Fmt
that is only used as a container to hold/produce
other Fmt
s via the dot access syntax is used directly. Contains the
full path to the format unit used in such fashion.
UnknownSubfmt(String)
Returned when a Fmt
does not contain a requested sub-Fmt
. Contains
the full path to the child format unit.
WrongNumberOfArguments(String, Ordering, usize)
Returned when a Fmt
was passed wrong number of arguments. The
Ordering
member specifies whether more, less or precisely the
expected number (given by the usize
field) is required.
InvalidArgument(String, usize, String)
Returned when a Fmt
is passed an argument it can’t process. Contains
the index and contents of the argument in error.