[][src]Struct bitrush_index::OZBCBitmap

pub struct OZBCBitmap { /* fields omitted */ }

Trait Implementations

impl<'_> BitAnd<&'_ OZBCBitmap> for &'_ OZBCBitmap[src]

Impl BitAnd running "logical and" bit operation between 2 bitmaps.

type Output = OZBCBitmap

The resulting type after applying the & operator.

impl Bitmap for OZBCBitmap[src]

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

fn new() -> OZBCBitmap[src]

Return new empty bitmap.

fn set(&mut self, i: u32)[src]

Set the ith bit (starting from zero). You must set the bitmap in increasing order otherwise nothing happend: set(0), set(16), set(1000) is the same of set(0), set(16), set(1000), set(50).

Example

use bitrush_index::OZBCBitmap;
use bitrush_index::Bitmap;

fn main() {        
    let mut b0 = OZBCBitmap::new();
    let mut b1 = b0.clone();
    let values = [0, 1, 100, 100000, 2,  100001];
    let values_ok = [0, 1, 100, 100000, 100001];
    for val in values.iter() {
        b0.set(*val);
    }
    for val in values_ok.iter() {
        b1.set(*val);
    }
    assert_eq!(b0, b1);
}

fn unroll_bitmap(&self) -> Vec<u32>[src]

Return a vector with all positions of set bit.

fn size(&self) -> usize[src]

Get bitmap content size.

fn write_to_buffer(&self, buffer_out: &mut [u8]) -> Result<usize, ()>[src]

Write bitmap content into buffer_out and return the number of bytes written.

fn read_from_buffer(
    &mut self,
    buffer_in: &[u8],
    check_bitmap: bool
) -> Result<(), ()>
[src]

Read bitmap content from buffer_in, buffer_in must have the exact length of bitmap content.

impl Clone for OZBCBitmap[src]

impl Debug for OZBCBitmap[src]

Impl [Debug] trait printing each bit of every bitmap words.

impl PartialEq<OZBCBitmap> for OZBCBitmap[src]

impl StructuralPartialEq for OZBCBitmap[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.