Skip to main content

Bitmap

Trait Bitmap 

Source
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§

Source

fn mark_dirty(&self, offset: usize, len: usize)

Mark the memory range specified by the given offset and len as dirtied.

Source

fn dirty_at(&self, offset: usize) -> bool

Check whether the specified offset is marked as dirty.

Source

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Bitmap for ()

Source§

fn mark_dirty(&self, _offset: usize, _len: usize)

Source§

fn dirty_at(&self, _offset: usize) -> bool

Source§

fn slice_at(&self, _offset: usize) -> Self

Source§

impl<B: Bitmap> Bitmap for Option<B>

Source§

fn mark_dirty(&self, offset: usize, len: usize)

Source§

fn dirty_at(&self, offset: usize) -> bool

Source§

fn slice_at(&self, offset: usize) -> Option<<B as WithBitmapSlice<'_>>::S>

Implementors§

Source§

impl Bitmap for AtomicBitmap

Available on crate feature backend-bitmap only.