pub enum LexicalErrorType {
UnclosedStringError,
UnicodeError,
MissingUnicodeLbrace,
MissingUnicodeRbrace,
IndentationError,
UnrecognizedToken {
tok: char,
},
FStringError(InterpolatedStringErrorType),
TStringError(InterpolatedStringErrorType),
InvalidByteLiteral,
LineContinuationError,
Eof,
OtherError(Box<str>),
// some variants omitted
}Expand description
Represents the different types of errors that can occur during lexing.
Variants§
UnclosedStringError
A string literal without the closing quote.
UnicodeError
Decoding of a unicode escape sequence in a string literal failed.
MissingUnicodeLbrace
Missing the { for unicode escape sequence.
MissingUnicodeRbrace
Missing the } for unicode escape sequence.
IndentationError
The indentation is not consistent.
UnrecognizedToken
An unrecognized token was encountered.
FStringError(InterpolatedStringErrorType)
An f-string error containing the InterpolatedStringErrorType.
TStringError(InterpolatedStringErrorType)
A t-string error containing the InterpolatedStringErrorType.
InvalidByteLiteral
Invalid character encountered in a byte literal.
LineContinuationError
An unexpected character was encountered after a line continuation.
Eof
An unexpected end of file was encountered.
OtherError(Box<str>)
An unexpected error occurred.
Trait Implementations§
Source§impl Clone for LexicalErrorType
impl Clone for LexicalErrorType
Source§fn clone(&self) -> LexicalErrorType
fn clone(&self) -> LexicalErrorType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LexicalErrorType
impl Debug for LexicalErrorType
Source§impl Display for LexicalErrorType
impl Display for LexicalErrorType
Source§impl Error for LexicalErrorType
impl Error for LexicalErrorType
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl GetSize for LexicalErrorType
impl GetSize for LexicalErrorType
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Determines how many bytes this object occupies inside the heap. Read more
Source§fn get_heap_size_with_tracker<TRACKER: GetSizeTracker>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)
fn get_heap_size_with_tracker<TRACKER: GetSizeTracker>( &self, tracker: TRACKER, ) -> (usize, TRACKER)
Determines how many bytes this object occupies inside the heap while using a
tracker. Read moreSource§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Determines how may bytes this object occupies inside the stack. Read more
Source§fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
Determines the total size of the object while using a
tracker. Read moreSource§impl PartialEq for LexicalErrorType
impl PartialEq for LexicalErrorType
impl Eq for LexicalErrorType
impl StructuralPartialEq for LexicalErrorType
Auto Trait Implementations§
impl Freeze for LexicalErrorType
impl RefUnwindSafe for LexicalErrorType
impl Send for LexicalErrorType
impl Sync for LexicalErrorType
impl Unpin for LexicalErrorType
impl UnsafeUnpin for LexicalErrorType
impl UnwindSafe for LexicalErrorType
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more