pub struct Bitmap<S: Storage, E: Element> { /* private fields */ }Expand description
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.
Implementations§
Source§impl<S: Storage, E: Element> Bitmap<S, E>
impl<S: Storage, E: Element> Bitmap<S, E>
pub fn from_storage(entries: usize, w: E::W, storage: S) -> Option<Bitmap<S, E>>
Sourcepub fn get(&self, i: usize) -> Option<E::R>
pub 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.
Sourcepub fn set(&mut self, i: usize, value: E::R) -> bool
pub 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.
pub fn iter(&self) -> Slices<'_, S, E> ⓘ
pub fn unwrap(self) -> S
Trait Implementations§
Auto Trait Implementations§
impl<S, E> Freeze for Bitmap<S, E>
impl<S, E> RefUnwindSafe for Bitmap<S, E>
impl<S, E> Send for Bitmap<S, E>
impl<S, E> Sync for Bitmap<S, E>
impl<S, E> Unpin for Bitmap<S, E>
impl<S, E> UnwindSafe for Bitmap<S, E>
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