#[non_exhaustive]pub enum ErrorKind<'a> {
Show 30 variants
Custom(&'a str),
UnexpectedEof,
FileTooLarge,
InvalidCharInString(char),
InvalidEscape(char),
InvalidHexEscape(char),
InvalidEscapeValue(u32),
Unexpected(char),
UnterminatedString(char),
InvalidInteger(&'static str),
InvalidFloat(&'static str),
InvalidDateTime(&'static str),
OutOfRange {
ty: &'static &'static str,
range: &'static &'static str,
},
Wanted {
expected: &'static &'static str,
found: &'static &'static str,
},
DuplicateTable {
name: Span,
first: Span,
},
DuplicateKey {
first: Span,
},
RedefineAsArray {
first: Span,
},
MultilineStringKey,
DottedKeyInvalidType {
first: Span,
},
UnexpectedKey {
tag: u32,
},
UnquotedString,
MissingField(&'static str),
DuplicateField {
field: &'static str,
first: Span,
},
Deprecated {
tag: u32,
old: &'static &'static str,
new: &'static &'static str,
},
UnexpectedValue {
expected: &'static [&'static str],
},
UnexpectedVariant {
expected: &'static [&'static str],
},
MissingArrayComma,
UnclosedArray,
MissingInlineTableComma,
UnclosedInlineTable,
}Expand description
The specific kind of error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Custom(&'a str)
A custom error message
UnexpectedEof
EOF was reached when looking for a value.
FileTooLarge
The input file is larger than the maximum supported size of 512 MiB.
InvalidCharInString(char)
An invalid character not allowed in a string was found.
InvalidEscape(char)
An invalid character was found as an escape.
InvalidHexEscape(char)
An invalid character was found in a hex escape.
InvalidEscapeValue(u32)
An invalid escape value was specified in a hex escape in a string.
Valid values are in the plane of unicode codepoints.
Unexpected(char)
An unexpected character was encountered, typically when looking for a value.
UnterminatedString(char)
An unterminated string was found where EOF or a newline was reached before the closing delimiter.
The char is the expected closing delimiter (" or ').
InvalidInteger(&'static str)
An integer literal failed to parse, with an optional reason.
InvalidFloat(&'static str)
A float literal failed to parse, with an optional reason.
InvalidDateTime(&'static str)
A datetime literal failed to parse, with an optional reason.
OutOfRange
The number in the toml file cannot be losslessly converted to the specified number type
Fields
Wanted
Wanted one sort of token, but found another.
Fields
DuplicateTable
A duplicate table definition was found.
Fields
DuplicateKey
Duplicate key in table.
RedefineAsArray
A previously defined table was redefined as an array.
MultilineStringKey
Multiline strings are not allowed for key.
DottedKeyInvalidType
Dotted key attempted to extend something that is not a table.
UnexpectedKey
An unexpected key was encountered.
Used when converting a struct with a limited set of fields.
Fields
UnquotedString
Unquoted string was found when quoted one was expected.
MissingField(&'static str)
A required field is missing from a table
DuplicateField
A field was set more than once (e.g. via primary key and alias)
Fields
Deprecated
A field in the table is deprecated and the new key should be used instead
Fields
UnexpectedValue
An unexpected value was encountered
UnexpectedVariant
A string did not match any known variant
MissingArrayComma
A comma is missing between elements in an array.
UnclosedArray
An array was not closed before EOF.
MissingInlineTableComma
A comma is missing between entries in an inline table.
UnclosedInlineTable
An inline table was not closed before EOF or a newline.