pub trait BitBlock: BitAnd<Output = Self> + BitOr<Output = Self> + BitXor<Output = Self> + Eq + PartialEq + Sized + Copy + Clone {
    type BitsIter: BitQueue;

    const SIZE_POT_EXPONENT: usize;

    // Required methods
    fn zero() -> Self;
    fn into_bits_iter(self) -> Self::BitsIter;
    fn as_array(&self) -> &[u64];
    fn as_array_mut(&mut self) -> &mut [u64];

    // Provided methods
    fn size() -> usize { ... }
    fn is_zero(&self) -> bool { ... }
    fn set_bit<const BIT: bool>(&mut self, bit_index: usize) -> bool { ... }
    fn get_bit(&self, bit_index: usize) -> bool { ... }
    fn traverse_bits<F>(&self, f: F) -> ControlFlow<()>
       where F: FnMut(usize) -> ControlFlow<()> { ... }
    fn count_ones(&self) -> usize { ... }
}
Expand description

Bit block.

Used in Config, to define bit blocks BitSet is built from.

Required Associated Types§

Required Associated Constants§

Required Methods§

source

fn zero() -> Self

source

fn into_bits_iter(self) -> Self::BitsIter

source

fn as_array(&self) -> &[u64]

source

fn as_array_mut(&mut self) -> &mut [u64]

Provided Methods§

source

fn size() -> usize

Size in bits

source

fn is_zero(&self) -> bool

source

fn set_bit<const BIT: bool>(&mut self, bit_index: usize) -> bool

Returns previous bit

bit_index is guaranteed to be valid

source

fn get_bit(&self, bit_index: usize) -> bool

bit_index is guaranteed to be valid

source

fn traverse_bits<F>(&self, f: F) -> ControlFlow<()>
where F: FnMut(usize) -> ControlFlow<()>,

Returns Break if traverse was interrupted (f returns Break).

source

fn count_ones(&self) -> usize

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl BitBlock for u64

source§

const SIZE_POT_EXPONENT: usize = 6usize

source§

fn zero() -> Self

source§

fn set_bit<const BIT: bool>(&mut self, bit_index: usize) -> bool

source§

fn get_bit(&self, bit_index: usize) -> bool

source§

fn traverse_bits<F>(&self, f: F) -> ControlFlow<()>
where F: FnMut(usize) -> ControlFlow<()>,

§

type BitsIter = PrimitiveBitQueue<u64>

source§

fn into_bits_iter(self) -> Self::BitsIter

source§

fn as_array(&self) -> &[u64]

source§

fn as_array_mut(&mut self) -> &mut [u64]

source§

impl BitBlock for u64x2

Available on crate feature simd only.
source§

const SIZE_POT_EXPONENT: usize = 7usize

source§

fn zero() -> Self

source§

fn is_zero(&self) -> bool

§

type BitsIter = ArrayBitQueue<u64, 2>

source§

fn into_bits_iter(self) -> Self::BitsIter

source§

fn as_array(&self) -> &[u64]

source§

fn as_array_mut(&mut self) -> &mut [u64]

source§

impl BitBlock for u64x4

Available on crate feature simd only.
source§

const SIZE_POT_EXPONENT: usize = 8usize

source§

fn zero() -> Self

§

type BitsIter = ArrayBitQueue<u64, 4>

source§

fn into_bits_iter(self) -> Self::BitsIter

source§

fn as_array(&self) -> &[u64]

source§

fn as_array_mut(&mut self) -> &mut [u64]

Implementors§