pub enum BitwiseOp {
And,
Or,
Xor,
Shl,
Shr,
UShr,
}Expand description
A bitwise operator is an operator used to perform bitwise operations on bit patterns or binary numerals that involve the manipulation of individual bits.
More information:
Variants§
And
Performs the AND operation on each pair of bits. a AND b yields 1 only if both a and b are 1.
Syntax: x & y
More information:
Or
Performs the OR operation on each pair of bits. a OR b yields 1 if either a or b is 1.
Syntax: x | y
More information:
Xor
Performs the XOR operation on each pair of bits. a XOR b yields 1 if a and b are different.
Syntax: x ^ y
More information:
Shl
This operator shifts the first operand the specified number of bits to the left.
Syntax: x << y
Excess bits shifted off to the left are discarded. Zero bits are shifted in from the right.
More information:
Shr
This operator shifts the first operand the specified number of bits to the right.
Syntax: x >> y
Excess bits shifted off to the right are discarded. Copies of the leftmost bit are shifted in from the left. Since the new leftmost bit has the same value as the previous leftmost bit, the sign bit (the leftmost bit) does not change. Hence the name “sign-propagating”.
More information:
UShr
This operator shifts the first operand the specified number of bits to the right.
Syntax: x >>> y
Excess bits shifted off to the right are discarded. Zero bits are shifted in from the left. The sign bit becomes 0, so the result is always non-negative. Unlike the other bitwise operators, zero-fill right shift returns an unsigned 32-bit integer.
More information:
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for BitwiseOp
impl<'arbitrary> Arbitrary<'arbitrary> for BitwiseOp
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 BitwiseOp
Source§impl<'de> Deserialize<'de> for BitwiseOp
impl<'de> Deserialize<'de> for BitwiseOp
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 BitwiseOp
impl StructuralPartialEq for BitwiseOp
Auto Trait Implementations§
impl Freeze for BitwiseOp
impl RefUnwindSafe for BitwiseOp
impl Send for BitwiseOp
impl Sync for BitwiseOp
impl Unpin for BitwiseOp
impl UnsafeUnpin for BitwiseOp
impl UnwindSafe for BitwiseOp
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.