[][src]Struct ddo::core::utils::BitSetIter

pub struct BitSetIter<'a> { /* fields omitted */ }

This structure defines an iterator capable of iterating over the 1-bits of a fixed bitset. It uses word representation of the items in the set, so it should be more efficient to use than a crude iteration over the elements of the set.

Example


let mut bit_set = BitSet::new(5);
bit_set.set(1, true);
bit_set.set(2, true);
bit_set.set(4, true);

// Successively prints 1, 2, 4
for x in BitSetIter::new(&bit_set) {
    println!("{}", x);
}

Methods

impl<'_> BitSetIter<'_>[src]

pub fn new(bs: &BitSet) -> BitSetIter[src]

This method creates an iterator for the given bitset from an immutable reference to that bitset.

Trait Implementations

impl<'_> Iterator for BitSetIter<'_>[src]

BitSetIter is an iterator over the one bits of the bitset. As such, it implements the standard Iterator trait.

type Item = usize

The type of the elements being iterated over.

fn next(&mut self) -> Option<Self::Item>[src]

Returns the nex element from the iteration, or None, if there are no more elements to iterate upon.

Auto Trait Implementations

impl<'a> RefUnwindSafe for BitSetIter<'a>

impl<'a> Send for BitSetIter<'a>

impl<'a> Sync for BitSetIter<'a>

impl<'a> Unpin for BitSetIter<'a>

impl<'a> UnwindSafe for BitSetIter<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.