Skip to main content

BitStorage

Trait BitStorage 

Source
pub trait BitStorage:
    Copy
    + Eq
    + Default
    + BitAnd<Output = Self>
    + BitOr<Output = Self>
    + BitOrAssign
    + Shl<u32, Output = Self>
    + Sub<Output = Self> {
    const WIDTH: u32;

    // Required methods
    fn one() -> Self;
    fn is_zero(self) -> bool;
    fn count_ones(self) -> u32;
    fn trailing_zeros(self) -> u32;
}
Expand description

Single-word storage backing a BitMap. Implemented for u8..u128 and U256.

Required Associated Constants§

Source

const WIDTH: u32

Number of bits this storage can hold (capacity of the bitmap).

Required Methods§

Source

fn one() -> Self

Source

fn is_zero(self) -> bool

Source

fn count_ones(self) -> u32

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".

Implementations on Foreign Types§

Source§

impl BitStorage for u8

Source§

const WIDTH: u32 = u8::BITS

Source§

fn one() -> Self

Source§

fn is_zero(self) -> bool

Source§

fn count_ones(self) -> u32

Source§

fn trailing_zeros(self) -> u32

Source§

impl BitStorage for u16

Source§

const WIDTH: u32 = u16::BITS

Source§

fn one() -> Self

Source§

fn is_zero(self) -> bool

Source§

fn count_ones(self) -> u32

Source§

fn trailing_zeros(self) -> u32

Source§

impl BitStorage for u32

Source§

const WIDTH: u32 = u32::BITS

Source§

fn one() -> Self

Source§

fn is_zero(self) -> bool

Source§

fn count_ones(self) -> u32

Source§

fn trailing_zeros(self) -> u32

Source§

impl BitStorage for u64

Source§

const WIDTH: u32 = u64::BITS

Source§

fn one() -> Self

Source§

fn is_zero(self) -> bool

Source§

fn count_ones(self) -> u32

Source§

fn trailing_zeros(self) -> u32

Source§

impl BitStorage for u128

Source§

const WIDTH: u32 = u128::BITS

Source§

fn one() -> Self

Source§

fn is_zero(self) -> bool

Source§

fn count_ones(self) -> u32

Source§

fn trailing_zeros(self) -> u32

Implementors§