logo
pub enum BitOp {
    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

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Marks all contained Gcs.
Increments the root-count of all contained Gcs.
Decrements the root-count of all contained Gcs.
Runs Finalize::finalize() on this object and all contained subobjects Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert the Rust type which implements NativeObject to a &dyn Any.
Convert the Rust type which implements NativeObject to a &mut dyn Any.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.