Trait Bitmap

Source
pub trait Bitmap
where Self: Clone + Debug, for<'a> &'a Self: BitAnd<&'a Self, Output = Self>,
{ // 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§

Source

fn new() -> Self

Return a new bitmap.

Source

fn set(&mut self, i: u32)

Set the ith bit (starting from zero).

Source

fn unroll_bitmap(&self) -> Vec<u32>

Return a Vec with all bit set positions.

Source

fn size(&self) -> usize

Return the effective size to serialize the bitmap.

Source

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.

Source

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§

Source§

impl Bitmap for OZBCBitmap

Impl Bitmap to allow to use OZBCBitmap in [BitmapIndex].