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.

Object Safety§

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§