Skip to main content

CollectionSnapshot

Struct CollectionSnapshot 

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

An immutable, lock-free-readable view of a single-vector collection (ADR-0064): the base index as of the last rebuild, the base id map, and the overlay of writes since. Obtained via Database::collection_snapshot and read with CollectionSnapshot::search; a read is snapshot-isolated — it sees one consistent (base, overlay) pair, and a write that lands mid-read is simply the next snapshot.

Implementations§

Source§

impl CollectionSnapshot

Source

pub fn search( &self, query: &[f32], k: usize, ef_search: usize, ) -> Result<Vec<Match>>

Lock-free nearest-neighbor search over the base index merged with the overlay (ADR-0064 increment 1) — pure vector reads: no payload filter and no payload/vector fetch (those need the store and land in increment 2). Returns the k nearest live points, closest first, scored in the true collection metric — identical ordering and scores to the locked Database::search_snapshot path for the same case.

§Errors

Propagates an index search error.

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.