Struct specs::BitSet
[−]
[src]
pub struct BitSet { // some fields omitted }
A BitSet is a simple set designed for tracking entity indexes
are present or not. It does not track the Generation
of the
entities that it contains.
Note, the BitSet is limited by design to only 1,048,576 indexs adding beyond this will cause the BitSet to panic.
Methods
impl BitSet
[src]
fn new() -> BitSet
Create an empty BitSet
fn with_capacity(max: Index) -> BitSet
Create an empty BitSet with up to max Index
fn add(&mut self, id: Index) -> bool
Add id
to the bitset. Returning if the value was
already in the set before it was added
fn remove(&mut self, id: Index) -> bool
Remove id
from the set, returns true if the value
was removed, returns false if the value was not set
to begin with
fn contains(&self, bit: u32) -> bool
Check to see if id
was included in the set
return true if it was, false otherwise
Trait Implementations
impl Clone for BitSet
[src]
fn clone(&self) -> BitSet
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl BitSetLike for BitSet
[src]
fn layer3(&self) -> u32
Return a u32 where each bit represents if any word in layer2 has been set. Read more
fn layer2(&self, i: usize) -> u32
Return the u32 from the array of u32s that indicates if any bit has been set in layer1 Read more
fn layer1(&self, i: usize) -> u32
Return the u32 from the array of u32s that indicates if any bit has been set in layer0 Read more
fn layer0(&self, i: usize) -> u32
Return a u32 that maps to the direct 1:1 association with each index of the set Read more
fn iter<'a>(&'a self) -> Iter<'a, Self> where Self: Sized
Create an iterator that will scan over the keyspace