Struct bitmap::Bitmap [] [src]

pub struct Bitmap<S: Storage, E: Element> {
    // some fields omitted
}

A dense bitmap, intended to store small bitslices (<= width of u64).

That is, this type represents an array of values, where each value is E::width(instance) bits long, and the bits are stored contiguously. The first value is packed into the least significant bits of the first word.

Methods

impl<S: Storage, E: Element> Bitmap<S, E>
[src]

fn from_storage(entries: usize, w: E::W, storage: S) -> Option<Bitmap<S, E>>

fn get(&self, i: usize) -> Option<E::R>

Get the ith bitslice, returning None on out-of-bounds or if E::from_bits returns None.

fn set(&mut self, i: usize, value: E::R) -> bool

Set the ith bitslice to value, returning false on out-of-bounds or if value contains bits outside of the least significant E::width(w) bits.

fn len(&self) -> usize

Length in number of bitslices cointained.

fn usize_len(&self) -> usize

Size of the internal buffer, in number of usizes.

fn iter(&self) -> Slices<S, E>

fn unwrap(self) -> S

impl<S: Storage> Bitmap<S, OneBit>
[src]

fn first_set(&self) -> Option<usize>

Return the index of the first bit set

Trait Implementations

impl<'a, S: Storage, E: Element> IntoIterator for &'a Bitmap<S, E>
[src]

type Item = E::R

The type of the elements being iterated over.

type IntoIter = Slices<'a, S, E>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Slices<'a, S, E>

Creates an iterator from a value. Read more