pub enum FStringErrorType {
UnclosedLbrace,
UnopenedRbrace,
ExpectedRbrace,
InvalidExpression(Box<ParseErrorType>),
InvalidConversionFlag,
EmptyExpression,
MismatchedDelimiter(char, char),
ExpressionNestedTooDeeply,
ExpressionCannotInclude(char),
SingleRbrace,
Unmatched(char),
UnterminatedString,
}
Expand description
Represents the different types of errors that can occur during parsing of an f-string.
Variants§
UnclosedLbrace
Expected a right brace after an opened left brace.
UnopenedRbrace
Expected a left brace after an ending right brace.
ExpectedRbrace
Expected a right brace after a conversion flag.
InvalidExpression(Box<ParseErrorType>)
An error occurred while parsing an f-string expression.
InvalidConversionFlag
An invalid conversion flag was encountered.
EmptyExpression
An empty expression was encountered.
MismatchedDelimiter(char, char)
An opening delimiter was not closed properly.
ExpressionNestedTooDeeply
Too many nested expressions in an f-string.
ExpressionCannotInclude(char)
The f-string expression cannot include the given character.
SingleRbrace
A single right brace was encountered.
Unmatched(char)
A closing delimiter was not opened properly.
UnterminatedString
Unterminated string.
Trait Implementations§
Source§impl Debug for FStringErrorType
impl Debug for FStringErrorType
Source§impl Display for FStringErrorType
impl Display for FStringErrorType
Source§impl PartialEq for FStringErrorType
impl PartialEq for FStringErrorType
impl StructuralPartialEq for FStringErrorType
Auto Trait Implementations§
impl Freeze for FStringErrorType
impl RefUnwindSafe for FStringErrorType
impl Send for FStringErrorType
impl Sync for FStringErrorType
impl Unpin for FStringErrorType
impl UnwindSafe for FStringErrorType
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> 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 more