pub enum RelationalOp {
Equal,
NotEqual,
StrictEqual,
StrictNotEqual,
GreaterThan,
GreaterThanOrEqual,
LessThan,
LessThanOrEqual,
In,
InstanceOf,
}Expand description
A relational operator compares its operands and returns a logical value based on whether the relation is true.
The operands can be numerical, string, logical, or object values. Strings are compared based on standard
lexicographical ordering, using Unicode values. In most cases, if the two operands are not of the same type,
JavaScript attempts to convert them to an appropriate type for the comparison. This behavior generally results in
comparing the operands numerically. The sole exceptions to type conversion within comparisons involve the === and !==
operators, which perform strict equality and inequality comparisons. These operators do not attempt to convert the operands
to compatible types before checking equality.
More information:
Variants§
Equal
The equality operator converts the operands if they are not of the same type, then applies strict comparison.
Syntax: y == y
If both operands are objects, then JavaScript compares internal references which are equal when operands refer to the same object in memory.
More information:
NotEqual
The inequality operator returns true if the operands are not equal.
Syntax: x != y
If the two operands are not of the same type, JavaScript attempts to convert the operands to an appropriate type for the comparison. If both operands are objects, then JavaScript compares internal references which are not equal when operands refer to different objects in memory.
More information:
StrictEqual
The identity operator returns true if the operands are strictly equal with no type
conversion.
Syntax: x === y
Returns true if the operands are equal and of the same type.
More information:
StrictNotEqual
The non-identity operator returns true if the operands are not equal and/or not of the
same type.
Syntax: x !== y
Returns true if the operands are of the same type but not equal, or are of different type.
More information:
GreaterThan
The greater than operator returns true if the left operand is greater than the right
operand.
Syntax: x > y
Returns true if the left operand is greater than the right operand.
More information:
GreaterThanOrEqual
The greater than or equal operator returns true if the left operand is greater than or
equal to the right operand.
Syntax: x >= y
Returns true if the left operand is greater than the right operand.
More information:
LessThan
The less than operator returns true if the left operand is less than the right operand.
Syntax: x < y
Returns true if the left operand is less than the right operand.
More information:
LessThanOrEqual
The less than or equal operator returns true if the left operand is less than or equal to
the right operand.
Syntax: x <= y
Returns true if the left operand is less than or equal to the right operand.
More information:
In
The in operator returns true if the specified property is in the specified object or
its prototype chain.
Syntax: prop in object
Returns true the specified property is in the specified object or its prototype chain.
More information:
InstanceOf
The instanceof operator returns true if the specified object is an instance of the
right hand side object.
Syntax: obj instanceof Object
Returns true the prototype property of the right hand side constructor appears anywhere
in the prototype chain of the object.
More information:
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for RelationalOp
impl<'arbitrary> Arbitrary<'arbitrary> for RelationalOp
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl Clone for RelationalOp
impl Clone for RelationalOp
Source§fn clone(&self) -> RelationalOp
fn clone(&self) -> RelationalOp
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RelationalOp
impl Debug for RelationalOp
Source§impl<'de> Deserialize<'de> for RelationalOp
impl<'de> Deserialize<'de> for RelationalOp
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>,
Source§impl Display for RelationalOp
impl Display for RelationalOp
Source§impl From<RelationalOp> for BinaryOp
impl From<RelationalOp> for BinaryOp
Source§fn from(op: RelationalOp) -> Self
fn from(op: RelationalOp) -> Self
Source§impl PartialEq for RelationalOp
impl PartialEq for RelationalOp
Source§impl Serialize for RelationalOp
impl Serialize for RelationalOp
impl Copy for RelationalOp
impl Eq for RelationalOp
impl StructuralPartialEq for RelationalOp
Auto Trait Implementations§
impl Freeze for RelationalOp
impl RefUnwindSafe for RelationalOp
impl Send for RelationalOp
impl Sync for RelationalOp
impl Unpin for RelationalOp
impl UnwindSafe for RelationalOp
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.