Enum arithmetic_parser::BinaryOp
source · #[non_exhaustive]pub enum BinaryOp {
Show 13 variants
Add,
Sub,
Mul,
Div,
Power,
Eq,
NotEq,
And,
Or,
Gt,
Lt,
Ge,
Le,
}
Expand description
Binary arithmetic operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Add
Addition (+
).
Sub
Subtraction (-
).
Mul
Multiplication (*
).
Div
Division (/
).
Power
Power (^
).
Eq
Equality (==
).
NotEq
Non-equality (!=
).
And
Boolean AND (&&
).
Or
Boolean OR (||
).
Gt
“Greater than” comparison.
Lt
“Lesser than” comparison.
Ge
“Greater or equal” comparison.
Le
“Lesser or equal” comparison.
Implementations§
source§impl BinaryOp
impl BinaryOp
sourcepub fn priority(self) -> OpPriority
pub fn priority(self) -> OpPriority
Returns the priority of this operation.
sourcepub fn is_arithmetic(self) -> bool
pub fn is_arithmetic(self) -> bool
Checks if this operation is arithmetic.
sourcepub fn is_comparison(self) -> bool
pub fn is_comparison(self) -> bool
Checks if this operation is a comparison.
sourcepub fn is_order_comparison(self) -> bool
pub fn is_order_comparison(self) -> bool
Checks if this operation is an order comparison.
Trait Implementations§
source§impl From<BinaryOp> for UnsupportedType
impl From<BinaryOp> for UnsupportedType
source§impl PartialEq for BinaryOp
impl PartialEq for BinaryOp
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 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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)