pub struct BitMap<'a> {
inner: &'a mut [u8],
}
Fields§
§inner: &'a mut [u8]
Implementations§
source§impl<'a> BitMap<'a>
impl<'a> BitMap<'a>
sourcepub fn from_slice_mut(inner: &'a mut [u8]) -> Self
pub fn from_slice_mut(inner: &'a mut [u8]) -> Self
Creates a new bitmap from an underlying buffer.
sourcepub fn set(&mut self, index: usize, value: bool) -> Result<()>
pub fn set(&mut self, index: usize, value: bool) -> Result<()>
Sets the bit at the given index.
sourcepub fn mark_first_elems(&mut self, n: usize, value: bool)
pub fn mark_first_elems(&mut self, n: usize, value: bool)
Marks the first n
bits in the bitmap with the given value.
pub fn len(&self) -> usize
Auto Trait Implementations§
impl<'a> RefUnwindSafe for BitMap<'a>
impl<'a> Send for BitMap<'a>
impl<'a> Sync for BitMap<'a>
impl<'a> Unpin for BitMap<'a>
impl<'a> !UnwindSafe for BitMap<'a>
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