#[non_exhaustive]pub(crate) enum ParseErrorKind {
Show 37 variants
Empty,
UnexpectedChar,
InvalidLiteral,
DoesNotStartWithDigit,
InvalidDigit,
NoDigits,
NoExponentDigits,
UnknownEscape,
UnterminatedEscape,
InvalidXEscape,
NonAsciiXEscape,
UnicodeEscapeInByteLiteral,
InvalidStartOfUnicodeEscape,
UnicodeEscapeWithoutBrace,
NonHexDigitInUnicodeEscape,
TooManyDigitInUnicodeEscape,
InvalidUnicodeEscapeChar,
UnterminatedUnicodeEscape,
UnterminatedCharLiteral,
OverlongCharLiteral,
EmptyCharLiteral,
UnterminatedByteLiteral,
OverlongByteLiteral,
EmptyByteLiteral,
NonAsciiInByteLiteral,
UnescapedSingleQuote,
UnescapedSpecialWhitespace,
DoesNotStartWithQuote,
UnterminatedRawString,
UnterminatedString,
InvalidStringLiteralStart,
InvalidByteLiteralStart,
InvalidByteStringLiteralStart,
IsolatedCr,
InvalidSuffix,
UnexpectedIntegerLit,
IntegerSuffixStartingWithE,
}
Expand description
Kinds of errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Empty
The input was an empty string
UnexpectedChar
An unexpected char was encountered.
InvalidLiteral
Literal was not recognized.
DoesNotStartWithDigit
Input does not start with decimal digit when trying to parse an integer.
InvalidDigit
A digit invalid for the specified integer base was found.
NoDigits
Integer literal does not contain any valid digits.
NoExponentDigits
Exponent of a float literal does not contain any digits.
UnknownEscape
An unknown escape code, e.g. \b
.
UnterminatedEscape
A started escape sequence where the input ended before the escape was finished.
InvalidXEscape
An \x
escape where the two digits are not valid hex digits.
NonAsciiXEscape
A string or character literal using the \xNN
escape where NN > 0x7F
.
UnicodeEscapeInByteLiteral
A \u{...}
escape in a byte or byte string literal.
InvalidStartOfUnicodeEscape
A Unicode escape that does not start with a hex digit.
UnicodeEscapeWithoutBrace
A \u{...}
escape that lacks the opening brace.
NonHexDigitInUnicodeEscape
In a \u{...}
escape, a non-hex digit and non-underscore character was
found.
TooManyDigitInUnicodeEscape
More than 6 digits found in unicode escape.
InvalidUnicodeEscapeChar
The value from a unicode escape does not represent a valid character.
UnterminatedUnicodeEscape
A \u{..
escape that is not terminated (lacks the closing brace).
UnterminatedCharLiteral
A character literal that’s not terminated.
OverlongCharLiteral
A character literal that contains more than one character.
EmptyCharLiteral
An empty character literal, i.e. ''
.
UnterminatedByteLiteral
OverlongByteLiteral
EmptyByteLiteral
NonAsciiInByteLiteral
UnescapedSingleQuote
A '
character was not escaped in a character or byte literal, or a "
character was not escaped in a string or byte string literal.
UnescapedSpecialWhitespace
A \n, \t or \r raw character in a char or byte literal.
DoesNotStartWithQuote
When parsing a character, byte, string or byte string literal directly and the input does not start with the corresponding quote character (plus optional raw string prefix).
UnterminatedRawString
Unterminated raw string literal.
UnterminatedString
String literal without a "
at the end.
InvalidStringLiteralStart
Invalid start for a string literal.
InvalidByteLiteralStart
Invalid start for a byte literal.
InvalidByteStringLiteralStart
IsolatedCr
An literal \r
character not followed by a \n
character in a
(raw) string or byte string literal.
InvalidSuffix
Literal suffix is not a valid identifier.
UnexpectedIntegerLit
Returned by Float::parse
if an integer literal (no fractional nor
exponent part) is passed.
IntegerSuffixStartingWithE
Integer suffixes cannot start with e
or E
as this conflicts with the
grammar for float literals.
Trait Implementations§
source§impl Clone for ParseErrorKind
impl Clone for ParseErrorKind
source§fn clone(&self) -> ParseErrorKind
fn clone(&self) -> ParseErrorKind
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ParseErrorKind
impl Debug for ParseErrorKind
source§impl PartialEq for ParseErrorKind
impl PartialEq for ParseErrorKind
impl Copy for ParseErrorKind
impl Eq for ParseErrorKind
impl StructuralPartialEq for ParseErrorKind
Auto Trait Implementations§
impl Freeze for ParseErrorKind
impl RefUnwindSafe for ParseErrorKind
impl Send for ParseErrorKind
impl Sync for ParseErrorKind
impl Unpin for ParseErrorKind
impl UnwindSafe for ParseErrorKind
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)