pub enum BinOp {
Show 18 variants
Add,
Sub,
Mul,
Div,
Mod,
Eq,
Ne,
Lt,
Gt,
Le,
Ge,
And,
Or,
BitAnd,
BitOr,
BitXor,
Shl,
Shr,
}Expand description
Binary operator. Used in expressions of the form lhs <op> rhs.
And/Or are short-circuiting and are lowered to control flow in the
CFG builder; they should never appear in CFG instructions.
Variants§
Implementations§
Source§impl BinOp
impl BinOp
Sourcepub const fn symbol(self) -> &'static str
pub const fn symbol(self) -> &'static str
Surface-syntax spelling (e.g. +, ==). Used in diagnostic messages.
pub const fn is_arithmetic(self) -> bool
pub const fn is_comparison(self) -> bool
pub const fn is_short_circuit(self) -> bool
pub const fn is_bitwise(self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BinOp
impl<'de> Deserialize<'de> for BinOp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 UnsafeUnpin 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