Struct compacts::bits::Set
[−]
[src]
pub struct Set { /* fields omitted */ }
Methods
impl Set
[src]
pub fn new() -> Self
[src]
pub fn clear(&mut self)
[src]
pub fn get(&self, x: u32) -> bool
[src]
pub fn put(&mut self, x: u32, enabled: bool) -> bool
[src]
pub fn insert(&mut self, x: u32) -> bool
[src]
pub fn remove(&mut self, x: u32) -> bool
[src]
pub fn optimize(&mut self)
[src]
pub fn bits<'a>(&'a self) -> impl Iterator<Item = u32> + 'a
[src]
impl Set
[src]
pub fn write_to<W: Write>(&self, write: W) -> Result<()>
[src]
pub fn read_from<R: Read>(read: R) -> Result<Self>
[src]
Trait Implementations
impl Index<u32> for Set
[src]
type Output = bool
The returned type after indexing.
fn index(&self, i: u32) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl<T: AsRef<[u32]>> From<T> for Set
[src]
impl<'a> FromIterator<Entry<'a>> for Set
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = Entry<'a>>,
[src]
I: IntoIterator<Item = Entry<'a>>,
Creates a value from an iterator. Read more
impl<'a> FromIterator<u32> for Set
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = u32>,
[src]
I: IntoIterator<Item = u32>,
Creates a value from an iterator. Read more
impl<'a> FromIterator<&'a u32> for Set
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = &'a u32>,
[src]
I: IntoIterator<Item = &'a u32>,
Creates a value from an iterator. Read more
impl IntoIterator for Set
[src]
type Item = Entry<'static>
The type of the elements being iterated over.
type IntoIter = SetEntries<'static>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
Creates an iterator from a value. Read more
impl<'a> IntoIterator for &'a Set
[src]
type Item = Entry<'a>
The type of the elements being iterated over.
type IntoIter = SetEntries<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
Creates an iterator from a value. Read more
impl PopCount<u64> for Set
[src]
const MAX_BOUND: u64
MAX_BOUND: u64 = 1 << 32
fn count1(&self) -> u64
[src]
fn count0(&self) -> T where
T: Sub<Output = T>,
[src]
T: Sub<Output = T>,
impl Rank<u32> for Set
[src]
fn rank1(&self, i: u32) -> u32
[src]
Returns occurences of non-zero bit in [0, i)
. rank1(i)
should be equal to i - self.rank0(i)
. Read more
fn rank0(&self, i: T) -> T where
T: Sub<Output = T> + Copy,
[src]
T: Sub<Output = T> + Copy,
Returns occurences of zero bit in [0, i)
. rank0(i)
should be equal to i - self.rank1(i)
. Read more
impl Select1<u32> for Set
[src]
fn select1(&self, c: u32) -> Option<u32>
[src]
Returns the position of 'c+1'th appearance of non-zero bit.
impl Select0<u32> for Set
[src]
fn select0(&self, c: u32) -> Option<u32>
[src]
Returns the position of 'c+1'th appearance of non-zero bit.
impl Debug for Set
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for Set
[src]
fn clone(&self) -> Set
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Set
[src]
impl PartialEq for Set
[src]
fn eq(&self, __arg_0: &Set) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Set) -> bool
[src]
This method tests for !=
.