Trait vm_memory::bitmap::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.

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§