pub enum Operator {
Show 31 variants
Eq,
NotEq,
Lt,
LtEq,
Gt,
GtEq,
Plus,
Minus,
Multiply,
Divide,
Modulo,
And,
Or,
IsDistinctFrom,
IsNotDistinctFrom,
RegexMatch,
RegexIMatch,
RegexNotMatch,
RegexNotIMatch,
LikeMatch,
ILikeMatch,
NotLikeMatch,
NotILikeMatch,
BitwiseAnd,
BitwiseOr,
BitwiseXor,
BitwiseShiftRight,
BitwiseShiftLeft,
StringConcat,
AtArrow,
ArrowAt,
}
Expand description
Operators applied to expressions
Variants§
Eq
Expressions are equal
NotEq
Expressions are not equal
Lt
Left side is smaller than right side
LtEq
Left side is smaller or equal to right side
Gt
Left side is greater than right side
GtEq
Left side is greater or equal to right side
Plus
Addition
Minus
Subtraction
Multiply
Multiplication operator, like *
Divide
Division operator, like /
Modulo
Remainder operator, like %
And
Logical AND, like &&
Or
Logical OR, like ||
IsDistinctFrom
IS DISTINCT FROM
(see distinct
)
IsNotDistinctFrom
IS NOT DISTINCT FROM
(see not_distinct
)
RegexMatch
Case sensitive regex match
RegexIMatch
Case insensitive regex match
RegexNotMatch
Case sensitive regex not match
RegexNotIMatch
Case insensitive regex not match
LikeMatch
Case sensitive pattern match
ILikeMatch
Case insensitive pattern match
NotLikeMatch
Case sensitive pattern not match
NotILikeMatch
Case insensitive pattern not match
BitwiseAnd
Bitwise and, like &
BitwiseOr
Bitwise or, like |
BitwiseXor
Bitwise xor, such as ^
in MySQL or #
in PostgreSQL
BitwiseShiftRight
Bitwise right, like >>
BitwiseShiftLeft
Bitwise left, like <<
StringConcat
String concat
AtArrow
At arrow, like @>
ArrowAt
Arrow at, like <@
Implementations§
Source§impl Operator
impl Operator
Sourcepub fn negate(&self) -> Option<Operator>
pub fn negate(&self) -> Option<Operator>
If the operator can be negated, return the negated operator otherwise return None
Sourcepub fn is_numerical_operators(&self) -> bool
pub fn is_numerical_operators(&self) -> bool
Return true if the operator is a numerical operator.
For example, ‘Binary(a, +, b)’ would be a numerical expression. PostgresSQL concept: https://www.postgresql.org/docs/7.0/operators2198.htm
Sourcepub fn supports_propagation(&self) -> bool
pub fn supports_propagation(&self) -> bool
Return true if the comparison operator can be used in interval arithmetic and constraint propagation
For example, ‘Binary(a, >, b)’ expression supports propagation.
Sourcepub fn is_comparison_operator(&self) -> bool
👎Deprecated since 43.0.0: please use supports_propagation
instead
pub fn is_comparison_operator(&self) -> bool
supports_propagation
insteadReturn true if the comparison operator can be used in interval arithmetic and constraint propagation
For example, ‘Binary(a, >, b)’ expression supports propagation.
Sourcepub fn is_logic_operator(&self) -> bool
pub fn is_logic_operator(&self) -> bool
Return true if the operator is a logic operator.
For example, ‘Binary(Binary(a, >, b), AND, Binary(a, <, b + 3))’ would be a logical expression.
Sourcepub fn swap(&self) -> Option<Operator>
pub fn swap(&self) -> Option<Operator>
Return the operator where swapping lhs and rhs wouldn’t change the result.
For example Binary(50, >=, a)
could also be represented as Binary(a, <=, 50)
.
Sourcepub fn precedence(&self) -> u8
pub fn precedence(&self) -> u8
Get the operator precedence use https://www.postgresql.org/docs/7.2/sql-precedence.html as a reference
Trait Implementations§
Source§impl PartialOrd for Operator
impl PartialOrd 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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§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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more