Skip to main content

BitmapIndex

Struct BitmapIndex 

Source
pub struct BitmapIndex { /* private fields */ }
Expand description

Roaring-bitmap-backed tag index.

Maps tag strings to roaring bitmaps for fast AND/OR/NOT set operations. Uses an internal u32 offset for each MemoryId.

Implementations§

Source§

impl BitmapIndex

Source

pub fn new() -> Self

Creates a new empty bitmap index.

Source

pub fn add_tag(&self, id: MemoryId, tag: &str)

Add a tag for the given memory id.

Source

pub fn remove_tag(&self, id: MemoryId, tag: &str)

Remove a tag for the given memory id.

Source

pub fn query_tag(&self, tag: &str) -> Vec<MemoryId>

Get all memory ids that have the given tag.

Source

pub fn query_tags_and(&self, tags: &[&str]) -> Vec<MemoryId>

Get memory ids that have ALL given tags (intersection).

Source

pub fn query_tags_or(&self, tags: &[&str]) -> Vec<MemoryId>

Get memory ids that have ANY of the given tags (union).

Source

pub fn remove_all(&self, id: MemoryId)

Remove all tags for a given memory id.

Source§

impl BitmapIndex

Source

pub fn save(&self, path: &Path) -> MenteResult<()>

Save the bitmap index to a JSON file.

Source

pub fn load(path: &Path) -> MenteResult<Self>

Load the bitmap index from a JSON file.

Trait Implementations§

Source§

impl Default for BitmapIndex

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V