pub enum ErrorKind {
Show 21 variants
UnexpectedEof,
InvalidCharInString(char),
InvalidEscape(char),
InvalidHexEscape(char),
InvalidEscapeValue(u32),
Unexpected(char),
UnterminatedString,
InvalidNumber,
OutOfRange(&'static str),
Wanted {
expected: &'static str,
found: &'static str,
},
DuplicateTable {
name: String,
first: Span,
},
DuplicateKey {
key: String,
first: Span,
},
RedefineAsArray,
MultilineStringKey,
Custom(Cow<'static, str>),
DottedKeyInvalidType {
first: Span,
},
UnexpectedKeys {
keys: Vec<(String, Span)>,
expected: Vec<String>,
},
UnquotedString,
MissingField(&'static str),
Deprecated {
old: &'static str,
new: &'static str,
},
UnexpectedValue {
expected: &'static [&'static str],
},
}
Expand description
Errors that can occur when deserializing a type.
Variants§
UnexpectedEof
EOF was reached when looking for a value.
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
An unterminated string was found where EOF was found before the ending EOF mark.
InvalidNumber
A number failed to parse.
OutOfRange(&'static str)
The number in the toml file cannot be losslessly converted to the specified number type
Wanted
Wanted one sort of token, but found another.
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.
Custom(Cow<'static, str>)
A custom error which could be generated when deserializing a particular type.
DottedKeyInvalidType
Dotted key attempted to extend something that is not a table.
UnexpectedKeys
An unexpected key was encountered.
Used when deserializing 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
Deprecated
A field in the table is deprecated and the new key should be used instead
Fields
UnexpectedValue
An unexpected value was encountered
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)