pub struct MetadataStore {
pub path: PathBuf,
/* private fields */
}Fields§
§path: PathBufImplementations§
Source§impl MetadataStore
impl MetadataStore
pub fn open(path: &Path) -> Result<Self>
pub fn open_with_pool_size(path: &Path, max_size: u32) -> Result<Self>
pub fn upsert( &self, id: &str, mmap_index: usize, record: &VectorRecord, ) -> Result<()>
Sourcepub fn upsert_batch(
&self,
items: &[(String, usize, &VectorRecord)],
) -> Result<()>
pub fn upsert_batch( &self, items: &[(String, usize, &VectorRecord)], ) -> Result<()>
Insert/replace many records in a single transaction (bulk load).
pub fn get(&self, id: &str) -> Result<(usize, VectorRecord)>
pub fn delete(&self, id: &str) -> Result<()>
pub fn list_active(&self) -> Result<Vec<(String, usize)>>
pub fn count_active(&self) -> Result<usize>
pub fn save_collection(&self, config: &CollectionConfig) -> Result<()>
pub fn load_collection(&self, name: &str) -> Result<CollectionConfig>
Sourcepub fn ensure_payload_indexes(&self, fields: &[String]) -> Result<()>
pub fn ensure_payload_indexes(&self, fields: &[String]) -> Result<()>
Ensure a SQLite expression index exists for each declared payload field, so selective filters on them are served from the index. Idempotent.
Sourcepub fn filter_ids(
&self,
filter: &Value,
indexed: &[String],
) -> Result<Vec<VectorId>>
pub fn filter_ids( &self, filter: &Value, indexed: &[String], ) -> Result<Vec<VectorId>>
Return ids of all active records whose payload matches filter.
Sourcepub fn filter_ids_indexed(
&self,
filter: &Value,
indexed: &[String],
) -> Result<Vec<(VectorId, usize)>>
pub fn filter_ids_indexed( &self, filter: &Value, indexed: &[String], ) -> Result<Vec<(VectorId, usize)>>
Like [filter_ids], but also returns each match’s mmap_index so the
caller can fetch its vector directly for a filtered brute-force scan
(predicate pushdown: candidates come from the filter, not the ANN index).
Fast path: the predicate is pushed into SQLite via json_extract, so the
engine returns only referenced scalars and we never full-parse the 95%+
of payloads a selective filter excludes. Falls back to a full in-process
scan for filter shapes the pushdown can’t represent identically.
pub fn list_collections(&self) -> Result<Vec<CollectionConfig>>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MetadataStore
impl !UnwindSafe for MetadataStore
impl Freeze for MetadataStore
impl Send for MetadataStore
impl Sync for MetadataStore
impl Unpin for MetadataStore
impl UnsafeUnpin for MetadataStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more