Enum pfmt::SingleFmtError

source ·
pub enum SingleFmtError {
    UnknownFlag(Stringchar),
    UnknownOption(StringString),
    InvalidOptionValue(StringStringString),
    NamespaceOnlyFmt(String),
    UnknownSubfmt(String),
    WrongNumberOfArguments(StringOrderingusize),
    InvalidArgument(StringusizeString),
}
Expand description

Errors that happen in individual Fmts. All of them contain the full path to the Fmt in error as the first field.

Variants

UnknownFlag(Stringchar)

Returned if a Fmt receives a flag it doesn’t know how to handle. It’s not actually used by the impls for the standard types, but you can use it if you wish to be strict. Contains the erroneous flag.

UnknownOption(StringString)

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(StringStringString)

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 Fmts 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 Fmtdoes not contain a requested sub-Fmt. Contains the full path to the child format unit.

WrongNumberOfArguments(StringOrderingusize)

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(StringusizeString)

Returned when a Fmt is passed an argument it can’t process. Contains the index and contents of the argument in error.

Trait Implementations

Formats the value using the given formatter. Read more
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.