pub enum BinOp {
Show 19 variants
Add,
Sub,
Mul,
Div,
And,
Or,
Eq,
Neq,
Lt,
Leq,
Gt,
Geq,
Assign,
In,
NotIn,
AddAssign,
SubAssign,
MulAssign,
DivAssign,
}Expand description
A binary operator.
Variants§
Add
The addition operator: +.
Sub
The subtraction operator: -.
Mul
The multiplication operator: *.
Div
The division operator: /.
And
The short-circuiting boolean and.
Or
The short-circuiting boolean or.
Eq
The equality operator: ==.
Neq
The inequality operator: !=.
Lt
The less-than operator: <.
Leq
The less-than or equal operator: <=.
Gt
The greater-than operator: >.
Geq
The greater-than or equal operator: >=.
Assign
The assignment operator: =.
In
The containment operator: in.
NotIn
The inverse containment operator: not in.
AddAssign
The add-assign operator: +=.
SubAssign
The subtract-assign operator: -=.
MulAssign
The multiply-assign operator: *=.
DivAssign
The divide-assign operator: /=.
Implementations§
Source§impl BinOp
impl BinOp
Sourcepub fn from_kind(token: SyntaxKind) -> Option<Self>
pub fn from_kind(token: SyntaxKind) -> Option<Self>
Try to convert the token into a binary operation.
Sourcepub fn precedence(self) -> u8
pub fn precedence(self) -> u8
The precedence of this operator.
Trait Implementations§
impl Copy for BinOp
impl Eq for BinOp
impl StructuralPartialEq for BinOp
Auto Trait Implementations§
impl Freeze for BinOp
impl RefUnwindSafe for BinOp
impl Send for BinOp
impl Sync for BinOp
impl Unpin for BinOp
impl UnwindSafe for BinOp
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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