pub enum Operation {
Add,
Subtract,
Multiply,
Divide,
Modulo,
Power,
}Expand description
Type-safe operation enum - compile-time guarantee of valid operations
Variants§
Add
Addition (+)
Subtract
Subtraction (-)
Multiply
Multiplication (*)
Divide
Division (/)
Modulo
Modulo (%)
Power
Power (^)
Implementations§
Source§impl Operation
impl Operation
Sourcepub const fn precedence(&self) -> u8
pub const fn precedence(&self) -> u8
Returns the precedence level for operator ordering (higher = evaluated first)
Sourcepub const fn is_left_associative(&self) -> bool
pub const fn is_left_associative(&self) -> bool
Returns true if this operation is left-associative
Trait Implementations§
impl Copy for Operation
impl Eq for Operation
impl StructuralPartialEq for Operation
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnsafeUnpin for Operation
impl UnwindSafe for Operation
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