pub enum BinaryOp {
Show 18 variants
Mul,
Div,
Rem,
Add,
Sub,
Shl,
Shr,
Lt,
Gt,
Le,
Ge,
Eq,
Ne,
BitAnd,
BitXor,
BitOr,
LogAnd,
LogOr,
}Expand description
An operator with two operands.
The comma operator is not here; it is Expr::Comma. Assignment is not here either, and
the operator part of a compound assignment reuses this enum, which is why the values that
cannot appear in one (BinaryOp::LogAnd and the comparisons) are simply never built by
the parser rather than being a second enum.
Variants§
Mul
*.
Div
/.
Rem
%.
Add
+.
Sub
-.
Shl
<<.
Shr
>>.
Lt
<.
Gt
>.
Le
<=.
Ge
>=.
Eq
==.
Ne
!=.
BitAnd
&.
BitXor
^.
BitOr
|.
LogAnd
&&, which does not evaluate its right operand unless it has to.
LogOr
||, likewise.
Implementations§
Trait Implementations§
impl Copy for BinaryOp
impl Eq for BinaryOp
impl StructuralPartialEq for BinaryOp
Auto Trait Implementations§
impl Freeze for BinaryOp
impl RefUnwindSafe for BinaryOp
impl Send for BinaryOp
impl Sync for BinaryOp
impl Unpin for BinaryOp
impl UnsafeUnpin for BinaryOp
impl UnwindSafe for BinaryOp
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