FiniteBitSet

Trait FiniteBitSet 

Source
pub trait FiniteBitSet: BitSet {
    const ALL: Self;
    const CAPACITY: u32;

    // Required methods
    fn negate(&mut self);
    fn reverse(&mut self);
    fn is_all(&self) -> bool;
    fn trailing_zeros(&self) -> u32;
    fn leading_zeros(&self) -> u32;
    fn leading_ones(&self) -> u32;

    // Provided methods
    fn with_negated(&self) -> Self
       where Self: Clone { ... }
    fn with_reversed(&self) -> Self
       where Self: Clone { ... }
    fn from_fn<F: FnMut(SetElement) -> bool>(f: F) -> Self { ... }
}

Required Associated Constants§

Source

const ALL: Self

The set of all possible elements

Source

const CAPACITY: u32

The total number of elements that can fit in this set

Required Methods§

Source

fn negate(&mut self)

Negate the elements in the set

Source

fn reverse(&mut self)

Reverse the elements of the set

Source

fn is_all(&self) -> bool

Source

fn trailing_zeros(&self) -> u32

Source

fn leading_zeros(&self) -> u32

Source

fn leading_ones(&self) -> u32

Provided Methods§

Source

fn with_negated(&self) -> Self
where Self: Clone,

Source

fn with_reversed(&self) -> Self
where Self: Clone,

Source

fn from_fn<F: FnMut(SetElement) -> bool>(f: F) -> Self

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.

Implementors§

Source§

impl FiniteBitSet for BitSet8

Source§

const ALL: Self = Self::ALL

Source§

const CAPACITY: u32 = 8u32

Source§

impl FiniteBitSet for BitSet16

Source§

const ALL: Self = Self::ALL

Source§

const CAPACITY: u32 = 16u32

Source§

impl FiniteBitSet for BitSet32

Source§

const ALL: Self = Self::ALL

Source§

const CAPACITY: u32 = 32u32

Source§

impl FiniteBitSet for BitSet64

Source§

const ALL: Self = Self::ALL

Source§

const CAPACITY: u32 = 64u32

Source§

impl FiniteBitSet for BitSet128

Source§

const ALL: Self = Self::ALL

Source§

const CAPACITY: u32 = 128u32

Source§

impl<const WORDS: usize> FiniteBitSet for BitSetArray<WORDS>

Source§

const ALL: Self = Self::ALL

Source§

const CAPACITY: u32 = Self::CAPACITY