[−][src]Struct bitrush_index::BitmapIndex
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]
<U as Shr<usize>>::Output: TransmuteToUsize,
&'a T: BitAnd<&'a T, Output = T>,
pub fn create(
bitmap_index_path: &Path,
build_options: BuildOptions
) -> Result<Self, Error>
[src]
bitmap_index_path: &Path,
build_options: BuildOptions
) -> Result<Self, Error>
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
:
- A file with 'mbidx' extension that represent
BitmapIndex
meta data. - A file with 'obidx' extension that represent all offsets of all bitmaps chunks.
- 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]
&mut self,
value: U,
start_index: Option<u64>,
end_index: Option<u64>
) -> Result<Vec<u64>, Error>
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]
storage_idx: &mut StorageIdx,
value: U,
start_index: Option<u64>,
end_index: Option<u64>,
meta_data: Option<MetaData>
) -> Result<Vec<u64>, Error>
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,
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for BitmapIndex<T, U> where
T: Send,
U: Send,
T: Send,
U: Send,
impl<T, U> Sync for BitmapIndex<T, U> where
T: Sync,
U: Sync,
T: Sync,
U: Sync,
impl<T, U> Unpin for BitmapIndex<T, U> where
T: Unpin,
U: Unpin,
T: Unpin,
U: Unpin,
impl<T, U> UnwindSafe for BitmapIndex<T, U> where
T: UnwindSafe,
U: UnwindSafe,
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,