[][src]Function classific::at_least

pub fn at_least<T, F>(is_at_least: F) -> AtLeast<T, F> where
    T: ?Sized,
    F: Fn(&T) -> bool

This function returns a Comparator for T which divides T instances into 2 categories.

See at_greatest and partial_order_or.

Examples

use std::cmp::Ordering;
use classific::{Comparator, at_least, partial_order_or};

assert_eq!(partial_order_or(at_least(|f: &f64| f.is_nan())).cmp(&f64::NAN, &1_f64), Ordering::Less);
assert_eq!(partial_order_or(at_least(|f: &f64| f.is_nan())).cmp(&f64::NAN, &f64::NAN), Ordering::Equal);
assert_eq!(partial_order_or(at_least(|f: &f64| f.is_nan())).cmp(&1_f64, &f64::NAN), Ordering::Greater);