Later Operator
This library provides a ComparisonOperator enum that can be used to parse, store, evaluate, and/or print Rust's relational operators: !=, <, <=, ==, >=, >.
Examples
use ComparisonOperator;
// Parse from a string, then compare two arbitrary values.
let op = try_from.unwrap;
assert!; // 3 <= 255
// Re-stringify the operator for printing or whatever.
assert_eq!;
// Leading/trailing whitespace is ignored when parsing.
assert_eq!;
// But the value has to make sense or it will fail.
assert!;
When the optional serde crate feature is enabled, ComparisonOperator can be de/serialized as a string too:
use ComparisonOperator;
use ;
Installation
Add later_operator to your dependencies in Cargo.toml, like:
[]
= "0.4.*"