#[non_exhaustive]pub enum BinOp {
Show 33 variants
Add(Plus),
Sub(Dash),
Div(Div),
Mul(Star),
Rem(Perc),
Eq(EqEq),
Neq(BangEq),
Gt(Gt),
Lt(Lt),
Gte(GtEq),
Lte(LtEq),
As(As),
Is(Is),
IsNot(IsNot),
And(AmpAmp),
Or(PipePipe),
Shl(LtLt),
Shr(GtGt),
BitAnd(Amp),
BitXor(Caret),
BitOr(Pipe),
AddAssign(PlusEq),
SubAssign(DashEq),
MulAssign(StarEq),
DivAssign(SlashEq),
RemAssign(PercEq),
BitAndAssign(AmpEq),
BitXorAssign(CaretEq),
BitOrAssign(PipeEq),
ShlAssign(LtLtEq),
ShrAssign(GtGtEq),
DotDot(DotDot),
DotDotEq(DotDotEq),
}
Expand description
A binary operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Add(Plus)
Addition a + b
.
Sub(Dash)
Subtraction a - b
.
Div(Div)
Division a / b
.
Mul(Star)
Multiplication a * b
.
Rem(Perc)
Remainder operator a % b
.
Eq(EqEq)
Equality check a == b
.
Neq(BangEq)
Inequality check a != b
.
Gt(Gt)
Greater-than check a > b
.
Lt(Lt)
Less-than check a < b
.
Gte(GtEq)
Greater-than or equal check a >= b
.
Lte(LtEq)
Less-than or equal check a <= b
.
As(As)
Type coercion a as b
.
Is(Is)
Instance of test a is b
.
IsNot(IsNot)
Negated instance of test a is not b
.
And(AmpAmp)
Lazy and operator &&
.
Or(PipePipe)
Lazy or operator ||
.
Shl(LtLt)
Bitwise left shift operator a << b
.
Shr(GtGt)
Bitwise right shift operator a >> b
.
BitAnd(Amp)
Bitwise and operator a & b
.
BitXor(Caret)
Bitwise xor operator a ^ b
.
BitOr(Pipe)
Bitwise or operator a | b
.
AddAssign(PlusEq)
Add assign a += b
.
SubAssign(DashEq)
Sub assign a -= b
.
MulAssign(StarEq)
Multiply assign operation a *= b
.
DivAssign(SlashEq)
Div assign a /= b
.
RemAssign(PercEq)
Remainder assign a %= b
.
BitAndAssign(AmpEq)
Bitwise and assign a &= b
.
BitXorAssign(CaretEq)
Bitwise xor assign a ^= b
.
BitOrAssign(PipeEq)
Bitwise or assign a |= b
.
ShlAssign(LtLtEq)
Left shift assign a <<= b
.
ShrAssign(GtGtEq)
Right shift assign a >>= b
.
DotDot(DotDot)
a .. b
.
DotDotEq(DotDotEq)
a ..= b
.
Trait Implementations§
Source§impl OptionSpanned for BinOp
impl OptionSpanned for BinOp
Source§fn option_span(&self) -> Option<Span>
fn option_span(&self) -> Option<Span>
Source§impl ToTokens for BinOp
impl ToTokens for BinOp
Source§fn to_tokens(
&self,
context: &mut MacroContext<'_, '_, '_>,
stream: &mut TokenStream,
) -> Result<()>
fn to_tokens( &self, context: &mut MacroContext<'_, '_, '_>, stream: &mut TokenStream, ) -> Result<()>
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
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)
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§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
key
and return true
if they are equal.