pub(crate) struct BitPage {
storage: [u64; 8],
length: u32,
}
Expand description
A fixed size (512 bits wide) page of bits that records integer set membership from [0, 511]
.
Fields§
§storage: [u64; 8]
§length: u32
Implementations§
Source§impl BitPage
impl BitPage
Sourcepub(crate) fn new_zeroes() -> Self
pub(crate) fn new_zeroes() -> Self
Create a new page with no bits set.
pub(crate) fn recompute_length(&mut self)
Sourcepub(crate) fn iter(&self) -> impl DoubleEndedIterator<Item = u32> + '_
pub(crate) fn iter(&self) -> impl DoubleEndedIterator<Item = u32> + '_
Iterator over the members of this page.
Sourcepub(crate) fn iter_from(
&self,
value: u32,
) -> impl DoubleEndedIterator<Item = u32> + '_
pub(crate) fn iter_from( &self, value: u32, ) -> impl DoubleEndedIterator<Item = u32> + '_
Iterator over the members of this page starting from value.
So value is included in the iterator if it’s in the page.
Sourcepub(crate) fn iter_ranges(&self) -> RangeIter<'_> ⓘ
pub(crate) fn iter_ranges(&self) -> RangeIter<'_> ⓘ
Iterator over the ranges in this page.
Sourcepub(crate) fn insert(&mut self, val: u32) -> bool
pub(crate) fn insert(&mut self, val: u32) -> bool
Marks (val % page width)
a member of this set and returns true
if it is newly added.
Sourcepub(crate) fn insert_range(&mut self, first: u32, last: u32)
pub(crate) fn insert_range(&mut self, first: u32, last: u32)
Marks all values [first, last]
as members of this set.
Sourcepub(crate) fn remove_range(&mut self, first: u32, last: u32)
pub(crate) fn remove_range(&mut self, first: u32, last: u32)
Marks all values [first, last]
as not members of this set.
pub(crate) fn clear(&mut self)
Sourcepub(crate) fn contains(&self, val: u32) -> bool
pub(crate) fn contains(&self, val: u32) -> bool
Return true if (val % page width)
is a member of this set.
pub(crate) fn union(a: &BitPage, b: &BitPage) -> BitPage
pub(crate) fn intersect(a: &BitPage, b: &BitPage) -> BitPage
pub(crate) fn subtract(a: &BitPage, b: &BitPage) -> BitPage
fn process<Op>(&self, other: &BitPage, op: Op) -> BitPage
fn element(&self, value: u32) -> &u64
fn element_mut(&mut self, value: u32) -> &mut u64
const fn element_index(value: u32) -> usize
Trait Implementations§
impl Eq for BitPage
Auto Trait Implementations§
impl Freeze for BitPage
impl RefUnwindSafe for BitPage
impl Send for BitPage
impl Sync for BitPage
impl Unpin for BitPage
impl UnwindSafe for BitPage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more