pub enum Operator {
LessThan,
LessThanEqual,
GreaterThan,
GreaterThanEqual,
NotEqual,
Exact,
Equal,
Exists,
}
Expand description
An operator token
This enum contains only non-equal operators due to their rarity. Including an equals operator would increase the size of the token list by up to 50%.
Variants§
LessThan
A <
token
LessThanEqual
A <=
token
GreaterThan
A >
token
GreaterThanEqual
A >=
token
NotEqual
A !=
token
Exact
A ==
token
Equal
A =
token
Exists
A ?=
token
Implementations§
source§impl Operator
impl Operator
sourcepub fn symbol(&self) -> &'static str
pub fn symbol(&self) -> &'static str
Returns the name of the operator using only letters
use jomini::text::Operator;
assert_eq!(Operator::LessThan.symbol(), "<");
assert_eq!(Operator::LessThanEqual.symbol(), "<=");
assert_eq!(Operator::GreaterThan.symbol(), ">");
assert_eq!(Operator::GreaterThanEqual.symbol(), ">=");
assert_eq!(Operator::Exact.symbol(), "==");
assert_eq!(Operator::NotEqual.symbol(), "!=");
assert_eq!(Operator::Equal.symbol(), "=");
assert_eq!(Operator::Exists.symbol(), "?=");
sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Returns the name of the operator using only letters
use jomini::text::Operator;
assert_eq!(Operator::LessThan.name(), "LESS_THAN");
assert_eq!(Operator::LessThanEqual.name(), "LESS_THAN_EQUAL");
assert_eq!(Operator::GreaterThan.name(), "GREATER_THAN");
assert_eq!(Operator::GreaterThanEqual.name(), "GREATER_THAN_EQUAL");
assert_eq!(Operator::Exact.name(), "EXACT");
assert_eq!(Operator::NotEqual.name(), "NOT_EQUAL");
assert_eq!(Operator::Equal.name(), "EQUAL");
assert_eq!(Operator::Exists.name(), "EXISTS");
Trait Implementations§
source§impl<'de> Deserialize<'de> for Operator
impl<'de> Deserialize<'de> for Operator
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Operator
impl PartialEq for Operator
impl Copy for Operator
impl Eq for Operator
impl StructuralPartialEq for Operator
Auto Trait Implementations§
impl Freeze for Operator
impl RefUnwindSafe for Operator
impl Send for Operator
impl Sync for Operator
impl Unpin for Operator
impl UnwindSafe for Operator
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more