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.
Sourcepub fn reverse_find(
&self,
is_set: bool,
bitoff: usize,
bitmax: usize,
run_len: usize,
) -> Result<usize, Status>
pub fn reverse_find( &self, is_set: bool, bitoff: usize, bitmax: usize, run_len: usize, ) -> Result<usize, Status>
Finds the last run of run_len is_set bits, in [bitoff, bitmax).
Returns the start of the run, or Status::NO_RESOURCES if not found.
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 moreSource§impl<S: Debug + Storage> Debug for RawBitmapGeneric<S>
impl<S: Debug + Storage> Debug for RawBitmapGeneric<S>
Source§impl<S: Default + Storage> Default for RawBitmapGeneric<S>
impl<S: Default + Storage> Default for RawBitmapGeneric<S>
Source§fn default() -> RawBitmapGeneric<S>
fn default() -> RawBitmapGeneric<S>
Auto 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§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), !>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), !>
slot. Read moreSource§fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
self then calls the function f with the initialized
value. Read more