Enum rurtle::parse::ast::CompOp [] [src]

pub enum CompOp {
    Equal,
    Less,
    Greater,
    LessEqual,
    GreaterEqual,
    NotEqual,
}

Different comparison operators

Variants

Equal
Less
Greater
LessEqual
GreaterEqual
NotEqual

Methods

impl CompOp

fn matches(&self, ord: &Ordering) -> bool

Returns true if CompOp self includes the given Ordering, that is the CompOp should return true if it compares two elements with the given Ordering

use std::cmp::Ordering;
assert_eq!(CompOp::Equal.matches(&Ordering::Equal), true);
assert_eq!(CompOp::Greater.matches(&Ordering::Less), false);

Trait Implementations

Derived Implementations

impl Clone for CompOp

fn clone(&self) -> CompOp

fn clone_from(&mut self, source: &Self)

impl Copy for CompOp

impl Debug for CompOp

fn fmt(&self, __arg_0: &mut Formatter) -> Result