pub trait Bitmap: for<'a> WithBitmapSlice<'a> {
// Required methods
fn mark_dirty(&self, offset: usize, len: usize);
fn dirty_at(&self, offset: usize) -> bool;
fn slice_at(&self, offset: usize) -> <Self as WithBitmapSlice<'_>>::S;
}
Expand description
Common bitmap operations. Using Higher-Rank Trait Bounds (HRTBs) to effectively define
an associated type that has a lifetime parameter, without tagging the Bitmap
trait with
a lifetime as well.
Using an associated type allows implementing the Bitmap
and BitmapSlice
functionality
as a zero-cost abstraction when providing trivial implementations such as the one
defined for ()
.
Required Methods§
sourcefn mark_dirty(&self, offset: usize, len: usize)
fn mark_dirty(&self, offset: usize, len: usize)
Mark the memory range specified by the given offset
and len
as dirtied.
sourcefn dirty_at(&self, offset: usize) -> bool
fn dirty_at(&self, offset: usize) -> bool
Check whether the specified offset
is marked as dirty.
sourcefn slice_at(&self, offset: usize) -> <Self as WithBitmapSlice<'_>>::S
fn slice_at(&self, offset: usize) -> <Self as WithBitmapSlice<'_>>::S
Return a <Self as WithBitmapSlice>::S
slice of the current bitmap, starting at
the specified offset
.