pub enum LogicalOp {
And,
Or,
Coalesce,
}Expand description
Logical operators are typically used with Boolean (logical) values; when they are, they return a Boolean value.
However, the && and || operators actually return the value of one of the specified operands,
so if these operators are used with non-Boolean values, they may return a non-Boolean value.
More information:
Variants§
And
The logical AND operator returns the value of the first operand if it can be coerced into false;
otherwise, it returns the second operand.
Syntax: x && y
More information:
Or
The logical OR operator returns the value the first operand if it can be coerced into true;
otherwise, it returns the second operand.
Syntax: x || y
More information:
Coalesce
The nullish coalescing operator is a logical operator that returns the second operand when its first operand is null or undefined, and otherwise returns its first operand.
Syntax: x ?? y
More information:
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for LogicalOp
impl<'arbitrary> Arbitrary<'arbitrary> for LogicalOp
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 moreimpl Copy for LogicalOp
Source§impl<'de> Deserialize<'de> for LogicalOp
impl<'de> Deserialize<'de> for LogicalOp
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>,
impl Eq for LogicalOp
impl StructuralPartialEq for LogicalOp
Auto Trait Implementations§
impl Freeze for LogicalOp
impl RefUnwindSafe for LogicalOp
impl Send for LogicalOp
impl Sync for LogicalOp
impl Unpin for LogicalOp
impl UnsafeUnpin for LogicalOp
impl UnwindSafe for LogicalOp
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.