predicates::ord

Function gt

Source
pub fn gt<T>(constant: T) -> OrdPredicate<T>
where T: PartialOrd + Debug,
Expand description

Creates a new predicate that will return true when the given variable is greater than a pre-defined value.

ยงExamples

use predicates::prelude::*;

let predicate_fn = predicate::gt(5);
assert_eq!(false, predicate_fn.eval(&4));
assert_eq!(false, predicate_fn.eval(&5));
assert_eq!(true, predicate_fn.eval(&6));