Trinary — Rust types for trinary logic
Based on TriState code base.
A three-valued type equivalent to Option<bool>
:
A nice way to use this type is with a domain-specific type alias via pub use
.
(For esoteric reasons, a
simple typedef-style type alias doesn't work, though this Rust limitation will
eventually be removed.) For example, a spam classifier:
extern crate tristate;
pub use TriState as Spam;
// ...
match message.classify