Trait bitslice::BitArray

source ·
pub trait BitArray: Sized + BitAnd<Output = Self> + BitOr<Output = Self> + BitXor<Output = Self> + Not<Output = Self> + Copy {
    const LEN: usize;

    // Required methods
    fn splat(s: bool) -> Self;
    fn get_bit(self, index: usize) -> bool;
    fn set_bit(&mut self, index: usize, sign: bool);
    fn count_ones(self) -> u32;
    fn transpose_in_place(a: &mut BitMatrix<Self, { Self::LEN }>);
}
Expand description

Things we can do to an array of bits.

Required Associated Constants§

source

const LEN: usize

Number of bits on the array.

Required Methods§

source

fn splat(s: bool) -> Self

Splats the sign across the bit array.

source

fn get_bit(self, index: usize) -> bool

Get a bit. Poor performance, used only for testing and debugging.

source

fn set_bit(&mut self, index: usize, sign: bool)

Set a bit. Poor performance, used only for testing and debugging.

source

fn count_ones(self) -> u32

source

fn transpose_in_place(a: &mut BitMatrix<Self, { Self::LEN }>)

Transpose a square matrix in place. This will likely be better performance than using Transpose::transpose().

Object Safety§

This trait is not object safe.

Implementors§

source§

impl BitArray for B8

source§

const LEN: usize = 8usize

source§

impl BitArray for B16

source§

const LEN: usize = 16usize

source§

impl BitArray for B32

source§

const LEN: usize = 32usize

source§

impl BitArray for B64

source§

const LEN: usize = 64usize

source§

impl BitArray for B128

source§

const LEN: usize = 128usize

source§

impl BitArray for B256

source§

const LEN: usize = 256usize

source§

impl BitArray for B512

source§

const LEN: usize = 512usize