pub enum BinOp {
Add,
Sub,
Div,
Mul,
Power,
Mod,
}Expand description
A binary operation type. Having a seperate enum for this avoids repitition and allows for some optimisations downstream.
Variants§
Add
Addition. Example: 10+14 is 24
Sub
Subtraction. Example: 5-3 is 2
Div
Division. Example: 32/4 is 8
Mul
Multiplication. Example: 5*11 is 55
Power
Power of. Example: (3^3 or 3**3) is 81
Mod
Modulo. Example: 20 % 2 is 0
Trait Implementations§
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
Mutably borrows from an owned value. Read more