MetadataStore

Trait MetadataStore 

Source
pub trait MetadataStore {
    // Required methods
    fn get_metadata(&self, id: usize) -> Option<&HashMap<String, MetadataValue>>;
    fn len(&self) -> usize;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Trait for accessing vector metadata during selectivity estimation.

This trait abstracts metadata storage to allow selectivity estimation without coupling to a specific storage implementation.

§Example

use edgevec::filter::strategy::MetadataStore;

struct MyMetadataStore {
    metadata: Vec<HashMap<String, MetadataValue>>,
}

impl MetadataStore for MyMetadataStore {
    fn get_metadata(&self, id: usize) -> Option<&HashMap<String, MetadataValue>> {
        self.metadata.get(id)
    }

    fn len(&self) -> usize {
        self.metadata.len()
    }
}

Required Methods§

Source

fn get_metadata(&self, id: usize) -> Option<&HashMap<String, MetadataValue>>

Get metadata for a vector by its ID.

Returns None if the ID is invalid or the vector has no metadata.

Source

fn len(&self) -> usize

Get the total number of vectors in the store.

Provided Methods§

Source

fn is_empty(&self) -> bool

Check if the store is empty.

Implementors§