#[non_exhaustive]pub enum Comparison {
Eq,
Ne,
Lt,
Le,
Gt,
Ge,
Contains,
StartsWith,
EndsWith,
Empty,
NotEmpty,
}Expand description
How a cell is compared with a rule’s value.
A numeric rule value (Value::Int or Value::Float) compares
numerically: a cell matches when it is a number, or text that parses as
one, and a cell that is neither never matches an ordering. A text value
compares as text, byte for byte. A Value::Null value matches empty
cells for Eq and the rest for
Ne. Ne is always the opposite of
Eq.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Eq
Equal (eq, ==).
Ne
Not equal (ne, !=).
Lt
Less than (lt, <).
Le
Less than or equal (le, <=).
Gt
Greater than (gt, >).
Ge
Greater than or equal (ge, >=).
Contains
The cell’s text contains the value’s (contains).
StartsWith
The cell’s text starts with the value’s (starts_with).
EndsWith
The cell’s text ends with the value’s (ends_with).
Empty
The cell is null or empty text (empty); the value is ignored.
NotEmpty
The cell is not empty (not_empty); the value is ignored.
Implementations§
Source§impl Comparison
impl Comparison
Sourcepub fn parse(name: &str) -> Option<Self>
pub fn parse(name: &str) -> Option<Self>
The comparison named name: a word (eq, starts_with) or a symbol
(==, <=).
Sourcepub fn name(self) -> &'static str
pub fn name(self) -> &'static str
The comparison’s word: eq, ne, lt, le, gt, ge, contains,
starts_with, ends_with, empty or not_empty.
Sourcepub fn symbol(self) -> Option<&'static str>
pub fn symbol(self) -> Option<&'static str>
The comparison’s symbol in a rule spec (StyleRule::parse): ==,
!=, <, <=, >, >=, *= (contains), ^= (starts with) or $=
(ends with); None for empty and not_empty, which are words.
Trait Implementations§
Source§impl Clone for Comparison
impl Clone for Comparison
impl Copy for Comparison
Source§impl Debug for Comparison
impl Debug for Comparison
impl Eq for Comparison
Source§impl PartialEq for Comparison
impl PartialEq for Comparison
impl StructuralPartialEq for Comparison
Auto Trait Implementations§
impl Freeze for Comparison
impl RefUnwindSafe for Comparison
impl Send for Comparison
impl Sync for Comparison
impl Unpin for Comparison
impl UnsafeUnpin for Comparison
impl UnwindSafe for Comparison
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.