pub enum Comparison {
Equal,
NotEqual,
Less,
LessOrEqual,
Greater,
GreaterOrEqual,
DistinctFrom,
NotDistinctFrom,
}Expand description
Which comparison.
Variants§
Equal
=, null if either side is null.
NotEqual
<>, null if either side is null.
Less
<, null if either side is null.
LessOrEqual
<=, null if either side is null.
Greater
>, null if either side is null.
GreaterOrEqual
>=, null if either side is null.
DistinctFrom
IS DISTINCT FROM, which is total and never null.
NotDistinctFrom
IS NOT DISTINCT FROM, which is total and never null.
Implementations§
Source§impl Comparison
impl Comparison
Sourcepub fn is_total(self) -> bool
pub fn is_total(self) -> bool
Whether this comparison treats null as a value rather than as an absence.
Sourcepub fn swapped(self) -> Self
pub fn swapped(self) -> Self
The comparison that means the same thing with the two sides exchanged.
This is what halves the number of specialized loops. A constant on the left against a column on the right is the column against the constant with the inequality turned around, and writing it that way means the column against constant loop is written once and tested once rather than twice with a chance of the second one being subtly wrong.
Trait Implementations§
Source§impl Clone for Comparison
impl Clone for Comparison
Source§fn clone(&self) -> Comparison
fn clone(&self) -> Comparison
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more