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.1.*"
License
Copyright © 2023 Blobfolio, LLC <hello@blobfolio.com>
This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.