Trait specs::BitSetLike
[−]
[src]
pub trait BitSetLike { fn layer3(&self) -> u32; fn layer2(&self, i: usize) -> u32; fn layer1(&self, i: usize) -> u32; fn layer0(&self, i: usize) -> u32; fn iter<'a>(&'a self) -> Iter<'a, Self> where Self: Sized { ... } }
A generic interface for BitSet like type
A bitset in specs
is hierarchal meaning that there
are multiple levels that branch out in a tree like structure
Layer0 has each bit representing one Index of the set Layer1 each bit represents one u32 of Layer0, and will be set only if the word below it is none zero. Layer2 has the same arrangement but with Layer1, and Layer4 with Layer4
This arrangement allows for rapid jumps across the key-space
Required Methods
fn layer3(&self) -> u32
Return a u32 where each bit represents if any word in layer2 has been set.
fn layer2(&self, i: usize) -> u32
Return the u32 from the array of u32s that indicates if any bit has been set in layer1
fn layer1(&self, i: usize) -> u32
Return the u32 from the array of u32s that indicates if any bit has been set in layer0
fn layer0(&self, i: usize) -> u32
Return a u32 that maps to the direct 1:1 association with each index of the set
Provided Methods
fn iter<'a>(&'a self) -> Iter<'a, Self> where Self: Sized
Create an iterator that will scan over the keyspace
Implementors
impl<'a, T> BitSetLike for &'a T where T: BitSetLike
impl BitSetLike for BitSet
impl<A: BitSetLike, B: BitSetLike> BitSetLike for BitSetAnd<A, B>