pub struct RleBitmapBase<T> { /* private fields */ }Expand description
A run-length encoded bitmap.
Implementations§
Source§impl<T> RleBitmapBase<T>
impl<T> RleBitmapBase<T>
Source§impl<T> RleBitmapBase<T>
impl<T> RleBitmapBase<T>
Sourcepub fn iter(&self) -> Iterator<'_, ElementPtr<T>>
pub fn iter(&self) -> Iterator<'_, ElementPtr<T>>
Returns an iterator over the elements of this bitmap.
Source§impl<T> RleBitmapBase<T>
impl<T> RleBitmapBase<T>
Sourcepub fn new() -> impl PinInit<Self, Infallible>
pub fn new() -> impl PinInit<Self, Infallible>
Create a new, empty run-length encoded bitmap.
Since the underlying intrusive list must be pinned in memory, this returns
an initializer that must be pinned (e.g. using pin_init::pin_init!).
Sourcepub fn num_ranges(&self) -> usize
pub fn num_ranges(&self) -> usize
Returns the current number of ranges (runs of set bits) in the bitmap.
Sourcepub fn set_no_alloc(
&mut self,
bitoff: T,
bitmax: T,
free_list: &mut FreeList<T>,
) -> Result<(), Status>
pub fn set_no_alloc( &mut self, bitoff: T, bitmax: T, free_list: &mut FreeList<T>, ) -> Result<(), Status>
Sets all bits in the range [bitoff, bitmax).
Only fails if bitmax < bitoff or if an allocation is needed and free_list
does not contain one.
free_list is a list of usable allocations. If an allocation is needed,
it will be drawn from it. This function is guaranteed to need at most
one allocation. If any nodes need to be deleted, they will be appended
to free_list.
Sourcepub fn clear_no_alloc(
&mut self,
bitoff: T,
bitmax: T,
free_list: &mut FreeList<T>,
) -> Result<(), Status>
pub fn clear_no_alloc( &mut self, bitoff: T, bitmax: T, free_list: &mut FreeList<T>, ) -> Result<(), Status>
Clears all bits in the range [bitoff, bitmax).
Only fails if bitmax < bitoff or if an allocation is needed and free_list
does not contain one.
free_list is a list of usable allocations. If an allocation is needed,
it will be drawn from it. This function is guaranteed to need at most
one allocation. If any nodes need to be deleted, they will be appended
to free_list.
Trait Implementations§
Source§impl<T> Bitmap<T> for RleBitmapBase<T>
impl<T> Bitmap<T> for RleBitmapBase<T>
Source§fn get(&self, bitoff: T, bitmax: T) -> GetResult<T>
fn get(&self, bitoff: T, bitmax: T) -> GetResult<T>
[bitoff, bitmax) are set. Read moreSource§fn set(&mut self, bitoff: T, bitmax: T) -> Result<(), Status>
fn set(&mut self, bitoff: T, bitmax: T) -> Result<(), Status>
[bitoff, bitmax). Read moreSource§impl<T: Debug> Debug for RleBitmapBase<T>
impl<T: Debug> Debug for RleBitmapBase<T>
Source§impl<T> HasPinData for RleBitmapBase<T>
impl<T> HasPinData for RleBitmapBase<T>
Source§impl<'a, T> IntoIterator for &'a RleBitmapBase<T>
impl<'a, T> IntoIterator for &'a RleBitmapBase<T>
Auto Trait Implementations§
impl<T> Freeze for RleBitmapBase<T>where
T: Freeze,
impl<T> !RefUnwindSafe for RleBitmapBase<T>
impl<T> !Send for RleBitmapBase<T>
impl<T> !Sync for RleBitmapBase<T>
impl<T> !UnsafeUnpin for RleBitmapBase<T>
impl<T> !UnwindSafe for RleBitmapBase<T>
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