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) -> usize
pub fn precedence(self) -> usize
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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