pub trait Bitmap{
// Required methods
fn new() -> Self;
fn set(&mut self, i: u32);
fn unroll_bitmap(&self) -> Vec<u32>;
fn size(&self) -> usize;
fn write_to_buffer(&self, buffer_out: &mut [u8]) -> Result<usize, ()>;
fn read_from_buffer(
&mut self,
buffer_in: &[u8],
check_bitmap: bool,
) -> Result<(), ()>;
}Required Methods§
Sourcefn unroll_bitmap(&self) -> Vec<u32>
fn unroll_bitmap(&self) -> Vec<u32>
Return a Vec with all bit set positions.
Sourcefn write_to_buffer(&self, buffer_out: &mut [u8]) -> Result<usize, ()>
fn write_to_buffer(&self, buffer_out: &mut [u8]) -> Result<usize, ()>
Write bitamp content into buffer_out and return the numbers of bytes written. Return a generic error if buffer_out size is less then bitmap size.
Sourcefn read_from_buffer(
&mut self,
buffer_in: &[u8],
check_bitmap: bool,
) -> Result<(), ()>
fn read_from_buffer( &mut self, buffer_in: &[u8], check_bitmap: bool, ) -> Result<(), ()>
Read bitmap content from buffer_in, buffer_in must have the effettive
bitmap content (the size returned from write_to_buffer method).
If check_bitmap == false bitmap content is readed without
any check on bitmap content integrity. Return a generic error an error occur.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl Bitmap for OZBCBitmap
Impl Bitmap to allow to use OZBCBitmap in [BitmapIndex].