[][src]Struct bitrush_index::BitmapIndex

pub struct BitmapIndex<T: Bitmap, U: BitValue> where
    <U as Shr<usize>>::Output: TransmuteToUsize,
    &'a T: BitAnd<&'a T, Output = T>, 
{ /* fields omitted */ }

BitmapIndex struct that requires a bitmap that implement Bitmap trait and a type that implement BitValue trait.

Methods

impl<T: Bitmap, U: BitValue> BitmapIndex<T, U> where
    <U as Shr<usize>>::Output: TransmuteToUsize,
    &'a T: BitAnd<&'a T, Output = T>, 
[src]

pub fn create(
    bitmap_index_path: &Path,
    build_options: BuildOptions
) -> Result<Self, Error>
[src]

Return a BitmapIndex in storage mode and create a folder with bitmap_index_path path. The created folder contain 3 files that represent a BitmapIndex:

  1. A file with 'mbidx' extension that represent BitmapIndex meta data.
  2. A file with 'obidx' extension that represent all offsets of all bitmaps chunks.
  3. A file with 'dbix' extension that represent all bitmaps chunks content.

pub fn open(dir_path: &Path) -> Result<Self, Error>[src]

Open a BitmapIndex in storage mode previusly created.

pub fn new_storage_idx(dir_path: &Path) -> Result<StorageIdx, Error>[src]

pub fn new(build_options: BuildOptions) -> Result<Self, Error>[src]

Return a new BitmapIndex in memory mode. A BitmapIndex created with this function works in memory and can't be serialized.

pub fn push_value(&mut self, value: U) -> Result<(), Error>[src]

Insert (in append) a value into the index. If BitmapIndex is opened in storage mode and the chunk is full, automatically the chunk is flushed on persistent memory.

pub fn flush_chunk(&mut self) -> Result<(), Error>[src]

Serialize current bitmaps chunk. Error occur if BitmapIndex is opened in memory mode.

pub fn push_values(&mut self, values: &[U]) -> Result<(), Error>[src]

Insert (in append) values into the index.

pub fn run_query(
    &mut self,
    value: U,
    start_index: Option<u64>,
    end_index: Option<u64>
) -> Result<Vec<u64>, Error>
[src]

Return a Vec<u64> that contains all indexes of values pushed in BitmapIndex equal to value. The parameters start_index and end_index are optional and if specified define the range where query is runned.

pub fn run_query_from_storage_idx(
    storage_idx: &mut StorageIdx,
    value: U,
    start_index: Option<u64>,
    end_index: Option<u64>,
    meta_data: Option<MetaData>
) -> Result<Vec<u64>, Error>
[src]

Return a Vec<u64> that contains all indexes of values pushed in a storage BitmapIndex equal to value. Differently from run_query method allow to run a query only on the chunks already flushed of a BitmapIndex.

Auto Trait Implementations

impl<T, U> RefUnwindSafe for BitmapIndex<T, U> where
    T: RefUnwindSafe,
    U: RefUnwindSafe

impl<T, U> Send for BitmapIndex<T, U> where
    T: Send,
    U: Send

impl<T, U> Sync for BitmapIndex<T, U> where
    T: Sync,
    U: Sync

impl<T, U> Unpin for BitmapIndex<T, U> where
    T: Unpin,
    U: Unpin

impl<T, U> UnwindSafe for BitmapIndex<T, U> where
    T: UnwindSafe,
    U: UnwindSafe

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, 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.