pub enum ComparisonOp {
Gt,
Geq,
Eq,
Neq,
Leq,
Lt,
}Expand description
Operators for comparing integer values
Variants§
Implementations§
Source§impl ComparisonOp
impl ComparisonOp
Sourcepub fn invert(self) -> Self
pub fn invert(self) -> Self
Invert the operation
This function can for example be useful when negating a comparison expression
§Example
use taco_threshold_automaton::expressions::ComparisonOp;
assert_eq!(ComparisonOp::Eq.invert(), ComparisonOp::Neq);
assert_eq!(ComparisonOp::Lt.invert(), ComparisonOp::Geq);Sourcepub fn get_swap_side(self) -> Self
pub fn get_swap_side(self) -> Self
Swap the side of the comparison operator
This is for example required when multiplying with negative constants
§Example
use taco_threshold_automaton::expressions::ComparisonOp;
assert_eq!(ComparisonOp::Eq.get_swap_side(), ComparisonOp::Eq);
assert_eq!(ComparisonOp::Lt.get_swap_side(), ComparisonOp::Gt);Trait Implementations§
Source§impl Clone for ComparisonOp
impl Clone for ComparisonOp
Source§fn clone(&self) -> ComparisonOp
fn clone(&self) -> ComparisonOp
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComparisonOp
impl Debug for ComparisonOp
Source§impl Display for ComparisonOp
impl Display for ComparisonOp
Source§impl From<ThresholdCompOp> for ComparisonOp
impl From<ThresholdCompOp> for ComparisonOp
Source§fn from(value: ThresholdCompOp) -> Self
fn from(value: ThresholdCompOp) -> Self
Converts to this type from the input type.
Source§impl Hash for ComparisonOp
impl Hash for ComparisonOp
Source§impl Ord for ComparisonOp
impl Ord for ComparisonOp
Source§fn cmp(&self, other: &ComparisonOp) -> Ordering
fn cmp(&self, other: &ComparisonOp) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ComparisonOp
impl PartialEq for ComparisonOp
Source§impl PartialOrd for ComparisonOp
impl PartialOrd for ComparisonOp
impl Copy for ComparisonOp
impl Eq for ComparisonOp
impl StructuralPartialEq for ComparisonOp
Auto Trait Implementations§
impl Freeze for ComparisonOp
impl RefUnwindSafe for ComparisonOp
impl Send for ComparisonOp
impl Sync for ComparisonOp
impl Unpin for ComparisonOp
impl UnwindSafe for ComparisonOp
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