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§
Sourcefn get_metadata(&self, id: usize) -> Option<&HashMap<String, MetadataValue>>
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.