pub enum Operator {
Show 25 variants
Newline,
And,
AndAnd,
OpenParen,
CloseParen,
Semicolon,
SemicolonAnd,
SemicolonSemicolon,
SemicolonSemicolonAnd,
SemicolonBar,
Less,
LessAnd,
LessOpenParen,
LessLess,
LessLessDash,
LessLessLess,
LessGreater,
Greater,
GreaterAnd,
GreaterOpenParen,
GreaterGreater,
GreaterGreaterBar,
GreaterBar,
Bar,
BarBar,
}
Expand description
Operator token identifier
Variants§
Newline
Newline
And
&
AndAnd
&&
OpenParen
(
CloseParen
)
Semicolon
;
SemicolonAnd
;&
SemicolonSemicolon
;;
SemicolonSemicolonAnd
;;&
SemicolonBar
;|
Less
<
LessAnd
<&
LessOpenParen
<(
LessLess
<<
LessLessDash
<<-
LessLessLess
<<<
LessGreater
<>
Greater
>
GreaterAnd
>&
GreaterOpenParen
>(
GreaterGreater
>>
GreaterGreaterBar
>>|
GreaterBar
>|
Bar
|
BarBar
||
Implementations§
Source§impl Operator
impl Operator
Sourcepub const fn as_str(&self) -> &'static str
pub const fn as_str(&self) -> &'static str
Returns the literal string representation of the operator.
Sourcepub const fn is_clause_delimiter(self) -> bool
pub const fn is_clause_delimiter(self) -> bool
Determines if this token can be a delimiter of a clause.
This function returns true
for the following operators:
CloseParen
()
)SemicolonAnd
(;&
)SemicolonSemicolon
(;;
)SemicolonSemicolonAnd
(;;&
)SemicolonBar
(;|
)
Trait Implementations§
Source§impl From<CaseContinuation> for Operator
impl From<CaseContinuation> for Operator
Source§fn from(cc: CaseContinuation) -> Operator
fn from(cc: CaseContinuation) -> Operator
Converts a case continuation into an operator.
The Continue
variant is converted into SemicolonBar
.
Source§impl TryFrom<Operator> for CaseContinuation
impl TryFrom<Operator> for CaseContinuation
Source§fn try_from(op: Operator) -> Result<CaseContinuation, TryFromOperatorError>
fn try_from(op: Operator) -> Result<CaseContinuation, TryFromOperatorError>
Converts an operator into a case continuation.
The SemicolonBar
and SemicolonSemicolonAnd
operators are converted
into Continue
; you cannot distinguish between the two from the return
value.
Source§type Error = TryFromOperatorError
type Error = TryFromOperatorError
The type returned in the event of a conversion error.
impl Copy for Operator
impl Eq for Operator
impl StructuralPartialEq for Operator
Auto Trait Implementations§
impl Freeze for Operator
impl RefUnwindSafe for Operator
impl Send for Operator
impl Sync for Operator
impl Unpin for Operator
impl UnwindSafe for Operator
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 more