pub enum Operator {
Equal,
EqualStar,
ExactEqual,
NotEqual,
NotEqualStar,
TildeEqual,
LessThan,
LessThanEqual,
GreaterThan,
GreaterThanEqual,
}Expand description
One of ~= == != <= >= < > ===
Variants§
Equal
== 1.2.3
EqualStar
== 1.2.*
ExactEqual
=== (discouraged)
https://peps.python.org/pep-0440/#arbitrary-equality
“Use of this operator is heavily discouraged and tooling MAY display a warning when it is used”
NotEqual
!= 1.2.3
NotEqualStar
!= 1.2.*
TildeEqual
~=
Invariant: With ~=, there are always at least 2 release segments.
LessThan
<
LessThanEqual
<=
GreaterThan
>
GreaterThanEqual
>=
Implementations§
Source§impl Operator
impl Operator
Sourcepub fn negate(self) -> Option<Operator>
pub fn negate(self) -> Option<Operator>
Negates this operator, if a negation exists, so that it has the opposite meaning.
This returns a negated operator in every case except for the ~=
operator. In that case, None is returned and callers may need to
handle its negation at a higher level. (For example, if it’s negated
in the context of a marker expression, then the “compatible” version
constraint can be split into its component parts and turned into a
disjunction of the negation of each of those parts.)
Note that this routine is not reversible in all cases. For example
Operator::ExactEqual negates to Operator::NotEqual, and
Operator::NotEqual in turn negates to Operator::Equal.
Trait Implementations§
impl Copy for Operator
impl Eq for Operator
Source§impl Ord for Operator
impl Ord for Operator
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Operator
impl PartialOrd 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 UnsafeUnpin 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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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