#[non_exhaustive]pub enum UnOp {
Not,
Neg,
Popcnt,
Clz,
Ctz,
Bswap,
BitRev,
}Expand description
Unary operators. All map a W-bit operand to a W-bit result.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Not
Bitwise complement.
Neg
Two’s-complement negation.
Popcnt
Number of set bits.
Clz
Number of leading zero bits; clz(0) = W.
Ctz
Number of trailing zero bits; ctz(0) = W.
Bswap
Byte reversal. Only defined when W % 8 == 0 (a typing rule, not partiality).
BitRev
Bit reversal.
Implementations§
Trait Implementations§
impl Copy for UnOp
impl Eq for UnOp
Source§impl Ord for UnOp
impl Ord for UnOp
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for UnOp
impl PartialOrd for UnOp
impl StructuralPartialEq for UnOp
Auto Trait Implementations§
impl Freeze for UnOp
impl RefUnwindSafe for UnOp
impl Send for UnOp
impl Sync for UnOp
impl Unpin for UnOp
impl UnsafeUnpin for UnOp
impl UnwindSafe for UnOp
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
Mutably borrows from an owned value. Read more