BitwiseOps

Trait BitwiseOps 

Source
pub trait BitwiseOps {
    // Required methods
    fn bitand(self, other: Self) -> Self;
    fn bitor(self, other: Self) -> Self;
    fn bitxor(self, other: Self) -> Self;
    fn inv(self) -> Self;
}
Expand description

Describes bitwise operations. If num_traits has this, we do not need our own implementation: https://github.com/rust-num/num-traits/issues/232

Required Methods§

Source

fn bitand(self, other: Self) -> Self

Perform bitwise and for two values.

Source

fn bitor(self, other: Self) -> Self

Perform bitwise or for two values.

Source

fn bitxor(self, other: Self) -> Self

Perform bitwise xor for two values.

Source

fn inv(self) -> Self

Perform bitwise invert (not) for the value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl BitwiseOps for u8

Source§

fn bitand(self, other: Self) -> Self

Source§

fn bitor(self, other: Self) -> Self

Source§

fn bitxor(self, other: Self) -> Self

Source§

fn inv(self) -> Self

Source§

impl BitwiseOps for u16

Source§

fn bitand(self, other: Self) -> Self

Source§

fn bitor(self, other: Self) -> Self

Source§

fn bitxor(self, other: Self) -> Self

Source§

fn inv(self) -> Self

Source§

impl BitwiseOps for u32

Source§

fn bitand(self, other: Self) -> Self

Source§

fn bitor(self, other: Self) -> Self

Source§

fn bitxor(self, other: Self) -> Self

Source§

fn inv(self) -> Self

Source§

impl BitwiseOps for u64

Source§

fn bitand(self, other: Self) -> Self

Source§

fn bitor(self, other: Self) -> Self

Source§

fn bitxor(self, other: Self) -> Self

Source§

fn inv(self) -> Self

Source§

impl BitwiseOps for usize

Source§

fn bitand(self, other: Self) -> Self

Source§

fn bitor(self, other: Self) -> Self

Source§

fn bitxor(self, other: Self) -> Self

Source§

fn inv(self) -> Self

Implementors§