pub enum BinOp {
Show 32 variants
Le(Le),
Ge(Ge),
Eq(EqEq),
Neq(Ne),
Or(OrOr),
And(AndAnd),
Assign(Eq),
AddAssign(PlusEq),
SubAssign(MinusEq),
MulAssign(StarEq),
DivAssign(SlashEq),
RemAssign(PercentEq),
BitAndAssign(AndEq),
BitOrAssign(OrEq),
BitXorAssign(CaretEq),
SarAssign(Shr, Ge),
ShlAssign(ShlEq),
ShrAssign(ShrEq),
Sar(Shr, Gt),
Shr(Shr),
Shl(Shl),
BitAnd(And),
BitOr(Or),
BitXor(Caret),
Lt(Lt),
Gt(Gt),
Add(Plus),
Sub(Minus),
Pow(Star, Star),
Mul(Star),
Div(Slash),
Rem(Percent),
}
Expand description
A binary operator: +
, +=
, &
.
Variants§
Le(Le)
<=
Ge(Ge)
>=
Eq(EqEq)
==
Neq(Ne)
!=
Or(OrOr)
||
And(AndAnd)
&&
Assign(Eq)
=
AddAssign(PlusEq)
+=
SubAssign(MinusEq)
-=
MulAssign(StarEq)
*=
DivAssign(SlashEq)
/=
RemAssign(PercentEq)
%=
BitAndAssign(AndEq)
&=
BitOrAssign(OrEq)
|=
BitXorAssign(CaretEq)
^=
SarAssign(Shr, Ge)
>>>=
ShlAssign(ShlEq)
<<=
ShrAssign(ShrEq)
>>=
Sar(Shr, Gt)
>>>
Shr(Shr)
>>
Shl(Shl)
<<
BitAnd(And)
&
BitOr(Or)
|
BitXor(Caret)
^
Lt(Lt)
<
Gt(Gt)
>
Add(Plus)
+
Sub(Minus)
-
Pow(Star, Star)
**
Mul(Star)
*
Div(Slash)
/
Rem(Percent)
%
Implementations§
Source§impl BinOp
impl BinOp
Sourcepub fn new_assign(span: Span) -> Self
pub fn new_assign(span: Span) -> Self
Creates a new Assign
operator with the given span
.
Sourcepub fn new_add_assign(span: Span) -> Self
pub fn new_add_assign(span: Span) -> Self
Creates a new AddAssign
operator with the given span
.
Sourcepub fn new_sub_assign(span: Span) -> Self
pub fn new_sub_assign(span: Span) -> Self
Creates a new SubAssign
operator with the given span
.
Sourcepub fn new_mul_assign(span: Span) -> Self
pub fn new_mul_assign(span: Span) -> Self
Creates a new MulAssign
operator with the given span
.
Sourcepub fn new_div_assign(span: Span) -> Self
pub fn new_div_assign(span: Span) -> Self
Creates a new DivAssign
operator with the given span
.
Sourcepub fn new_rem_assign(span: Span) -> Self
pub fn new_rem_assign(span: Span) -> Self
Creates a new RemAssign
operator with the given span
.
Sourcepub fn new_bit_and_assign(span: Span) -> Self
pub fn new_bit_and_assign(span: Span) -> Self
Creates a new BitAndAssign
operator with the given span
.
Sourcepub fn new_bit_or_assign(span: Span) -> Self
pub fn new_bit_or_assign(span: Span) -> Self
Creates a new BitOrAssign
operator with the given span
.
Sourcepub fn new_bit_xor_assign(span: Span) -> Self
pub fn new_bit_xor_assign(span: Span) -> Self
Creates a new BitXorAssign
operator with the given span
.
Sourcepub fn new_sar_assign(span: Span) -> Self
pub fn new_sar_assign(span: Span) -> Self
Creates a new SarAssign
operator with the given span
.
Sourcepub fn new_shl_assign(span: Span) -> Self
pub fn new_shl_assign(span: Span) -> Self
Creates a new ShlAssign
operator with the given span
.
Sourcepub fn new_shr_assign(span: Span) -> Self
pub fn new_shr_assign(span: Span) -> Self
Creates a new ShrAssign
operator with the given span
.
Sourcepub fn new_bit_and(span: Span) -> Self
pub fn new_bit_and(span: Span) -> Self
Creates a new BitAnd
operator with the given span
.
Sourcepub fn new_bit_or(span: Span) -> Self
pub fn new_bit_or(span: Span) -> Self
Creates a new BitOr
operator with the given span
.
Sourcepub fn new_bit_xor(span: Span) -> Self
pub fn new_bit_xor(span: Span) -> Self
Creates a new BitXor
operator with the given span
.
pub fn peek(input: ParseStream<'_>, lookahead: &Lookahead1<'_>) -> bool
pub const fn as_str(self) -> &'static str
pub const fn as_debug_str(self) -> &'static str
Sourcepub const fn is_add_assign(self) -> bool
pub const fn is_add_assign(self) -> bool
Returns true if self
matches Self::AddAssign
.
Sourcepub const fn is_sub_assign(self) -> bool
pub const fn is_sub_assign(self) -> bool
Returns true if self
matches Self::SubAssign
.
Sourcepub const fn is_mul_assign(self) -> bool
pub const fn is_mul_assign(self) -> bool
Returns true if self
matches Self::MulAssign
.
Sourcepub const fn is_div_assign(self) -> bool
pub const fn is_div_assign(self) -> bool
Returns true if self
matches Self::DivAssign
.
Sourcepub const fn is_rem_assign(self) -> bool
pub const fn is_rem_assign(self) -> bool
Returns true if self
matches Self::RemAssign
.
Sourcepub const fn is_bit_and_assign(self) -> bool
pub const fn is_bit_and_assign(self) -> bool
Returns true if self
matches Self::BitAndAssign
.
Sourcepub const fn is_bit_or_assign(self) -> bool
pub const fn is_bit_or_assign(self) -> bool
Returns true if self
matches Self::BitOrAssign
.
Sourcepub const fn is_bit_xor_assign(self) -> bool
pub const fn is_bit_xor_assign(self) -> bool
Returns true if self
matches Self::BitXorAssign
.
Sourcepub const fn is_sar_assign(self) -> bool
pub const fn is_sar_assign(self) -> bool
Returns true if self
matches Self::SarAssign
.
Sourcepub const fn is_shl_assign(self) -> bool
pub const fn is_shl_assign(self) -> bool
Returns true if self
matches Self::ShlAssign
.
Sourcepub const fn is_shr_assign(self) -> bool
pub const fn is_shr_assign(self) -> bool
Returns true if self
matches Self::ShrAssign
.
Sourcepub const fn is_bit_and(self) -> bool
pub const fn is_bit_and(self) -> bool
Returns true if self
matches Self::BitAnd
.
Sourcepub const fn is_bit_xor(self) -> bool
pub const fn is_bit_xor(self) -> bool
Returns true if self
matches Self::BitXor
.
Trait Implementations§
Source§impl Spanned for BinOp
impl Spanned for BinOp
Source§fn span(&self) -> Span
fn span(&self) -> Span
Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty.