pub struct RawBitmapGeneric<S: Storage> { /* private fields */ }Expand description
A simple bitmap backed by generic storage.
Implementations§
Source§impl<S: Storage> RawBitmapGeneric<S>
impl<S: Storage> RawBitmapGeneric<S>
Sourcepub fn storage_mut(&mut self) -> &mut S
pub fn storage_mut(&mut self) -> &mut S
Access the underlying storage mutably.
Sourcepub fn shrink(&mut self, size: usize) -> Result<(), Status>
pub fn shrink(&mut self, size: usize) -> Result<(), Status>
Shrinks the accessible portion of the bitmap, without re-allocating the underlying storage.
This is useful for programs which require underlying bitmap storage to be aligned to a certain size (initialized via Reset), but want to restrict access to a smaller portion of the bitmap (via Shrink).
Sourcepub fn scan(&self, bitoff: usize, bitmax: usize, is_set: bool) -> Option<usize>
pub fn scan(&self, bitoff: usize, bitmax: usize, is_set: bool) -> Option<usize>
Returns true if all bits in the range [bitoff, bitmax) match is_set.
If they do not match, returns false and the index of the first bit that doesn’t match.
An empty region (i.e. bitoff >= bitmax) will return true.
Sourcepub fn reverse_scan(
&self,
bitoff: usize,
bitmax: usize,
is_set: bool,
) -> Option<usize>
pub fn reverse_scan( &self, bitoff: usize, bitmax: usize, is_set: bool, ) -> Option<usize>
Returns true if all bits in the range [bitoff, bitmax) match is_set, scanning in reverse.
If they do not match, returns false and the index of the last bit that doesn’t match.
An empty region (i.e. bitoff >= bitmax) will return true.
Trait Implementations§
Source§impl<S: Storage> Bitmap<usize> for RawBitmapGeneric<S>
impl<S: Storage> Bitmap<usize> for RawBitmapGeneric<S>
Source§fn find(
&self,
is_set: bool,
bitoff: usize,
bitmax: usize,
run_len: usize,
) -> Result<usize, Status>
fn find( &self, is_set: bool, bitoff: usize, bitmax: usize, run_len: usize, ) -> Result<usize, Status>
Source§fn get(&self, bitoff: usize, bitmax: usize) -> GetResult<usize>
fn get(&self, bitoff: usize, bitmax: usize) -> GetResult<usize>
[bitoff, bitmax) are set. Read moreSource§fn set(&mut self, bitoff: usize, bitmax: usize) -> Result<(), Status>
fn set(&mut self, bitoff: usize, bitmax: usize) -> Result<(), Status>
[bitoff, bitmax). Read moreAuto Trait Implementations§
impl<S> Freeze for RawBitmapGeneric<S>where
S: Freeze,
impl<S> RefUnwindSafe for RawBitmapGeneric<S>where
S: RefUnwindSafe,
impl<S> Send for RawBitmapGeneric<S>where
S: Send,
impl<S> Sync for RawBitmapGeneric<S>where
S: Sync,
impl<S> Unpin for RawBitmapGeneric<S>where
S: Unpin,
impl<S> UnsafeUnpin for RawBitmapGeneric<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for RawBitmapGeneric<S>where
S: UnwindSafe,
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
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
slot. Read more