#[non_exhaustive]pub enum Error {
Show 16 variants
IO(Box<str>, Error),
IllegalCharacter(Location, char),
InvalidUtf8(Location),
BadInt(Location, Box<str>),
BadUInt(Location, Box<str>),
BadFloat(Location, Box<str>),
BadBool(Location, Box<str>),
UnmatchedLeftBrace(Location),
InvalidKey(Location, Box<str>),
InvalidValue(Location),
InvalidLine(Location),
StrayCharsAfterString(Location),
UnterminatedString(Location, char),
InvalidEscapeSequence(Location, Box<str>),
DuplicateKey(Box<str>, Location, Location),
Multiple(Box<[Error]>),
}Expand description
A parsing error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
IO(Box<str>, Error)
I/O error
The first field is a description of what led to the error.
IllegalCharacter(Location, char)
Illegal character in POM file
Specifically, an ASCII control character other than LF, CR immediately followed by LF, and tab.
InvalidUtf8(Location)
Invalid UTF-8 in POM file
BadInt(Location, Box<str>)
Couldn’t parse signed integer.
BadUInt(Location, Box<str>)
Couldn’t parse unsigned integer.
BadFloat(Location, Box<str>)
Couldn’t parse floating-point number.
BadBool(Location, Box<str>)
Couldn’t parse boolean.
UnmatchedLeftBrace(Location)
Opening [ without matching ].
InvalidKey(Location, Box<str>)
Key contains invalid characters.
The valid characters are anything outside of ASCII,
as well as a–z, A–Z, 0–9, and each of /.-*_.
InvalidValue(Location)
Value contains a null character.
These are not allowed for interoperability with languages with null-terminated strings (C).
InvalidLine(Location)
Line is not a [section-header] or key = value.
StrayCharsAfterString(Location)
Characters appear after a quoted value.
e.g. key = "value" foo
UnterminatedString(Location, char)
String opened but never closed with a matching character.
InvalidEscapeSequence(Location, Box<str>)
Invalid escape sequence appears in a quoted value.
DuplicateKey(Box<str>, Location, Location)
Key is defined twice in a file
Multiple(Box<[Error]>)
Used when there is more than one error in a file.
None of the errors in the array will be Error::Multiple’s,
and the array will contain at least two elements.