Trait BitBlock

Source
pub trait BitBlock:
    Copy
    + Eq
    + Not<Output = Self>
    + BitAnd<Self, Output = Self>
    + BitAndAssign
    + BitOr<Self, Output = Self>
    + Shl<usize, Output = Self> {
    const BITS: u32;
    const ONE: Self;
    const ZERO: Self;

    // Required methods
    fn wrapping_sub(self, rhs: Self) -> Self;
    fn trailing_zeros(self) -> u32;
}
Expand description

A type used to represent blocks in a bit set. A smaller type, compared to usize, means taking less advantage of native operations. A larger type means we might over-allocate more.

Required Associated Constants§

Source

const BITS: u32

The number of bits that Self can represent.

Source

const ONE: Self

The first bit is set.

Source

const ZERO: Self

No bits are set.

Required Methods§

Source

fn wrapping_sub(self, rhs: Self) -> Self

Source

fn trailing_zeros(self) -> u32

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 BitBlock for u64

Source§

const BITS: u32 = 64u32

Source§

const ONE: Self = 1u64

Source§

const ZERO: Self = 0u64

Source§

fn wrapping_sub(self, rhs: Self) -> Self

Source§

fn trailing_zeros(self) -> u32

Implementors§