pub struct SealedRingDb<T: Payload = ()> { /* private fields */ }Expand description
Sealed (immutable) ring-query database.
Obtained by calling RingDb::build() or RingDb::load().
The hot side (vectors + norms) is owned by the compute backend.
The cold side (payloads) lives in a file-backed mmap via T::Store.
Implementations§
Source§impl<T: Payload> SealedRingDb<T>
impl<T: Payload> SealedRingDb<T>
Sourcepub fn query(&self, q: &RingQuery<'_>) -> Result<QueryResult>
pub fn query(&self, q: &RingQuery<'_>) -> Result<QueryResult>
Execute a ring query and return matching vector IDs.
Sourcepub fn query_range(&self, q: &RangeQuery<'_>) -> Result<QueryResult>
pub fn query_range(&self, q: &RangeQuery<'_>) -> Result<QueryResult>
Execute a range query: all vectors with distance in [d_min, d_max].
Sourcepub fn query_disk(&self, q: &DiskQuery<'_>) -> Result<QueryResult>
pub fn query_disk(&self, q: &DiskQuery<'_>) -> Result<QueryResult>
Execute a disk query: all vectors within radius d_max.
Sourcepub fn fetch_payload(&self, id: u32) -> Result<T>
pub fn fetch_payload(&self, id: u32) -> Result<T>
Fetch and deserialize the payload for a single vector ID.
Sourcepub fn fetch_payloads(&self, ids: &[u32]) -> Result<Vec<T>>
pub fn fetch_payloads(&self, ids: &[u32]) -> Result<Vec<T>>
Fetch and deserialize payloads for a slice of IDs, in order.
Sourcepub fn backend_name(&self) -> &str
pub fn backend_name(&self) -> &str
Name of the backend currently in use.
Source§impl<T: Payload> SealedRingDb<T>where
T::Store: RefPayloadStore<T>,
impl<T: Payload> SealedRingDb<T>where
T::Store: RefPayloadStore<T>,
Sourcepub fn fetch_pod(&self, id: u32) -> &T
pub fn fetch_pod(&self, id: u32) -> &T
Fetch a zero-copy reference to the payload for a single vector ID.
Returns a &T pointing directly into the mmap — O(1), no allocation,
no deserialization. Only available for #[payload(storage = "pod")] types.
Sourcepub fn fetch_pods<'a>(&'a self, ids: &[u32]) -> Vec<&'a T>
pub fn fetch_pods<'a>(&'a self, ids: &[u32]) -> Vec<&'a T>
Fetch zero-copy references to payloads for a slice of IDs, in order.
Auto Trait Implementations§
impl<T> Freeze for SealedRingDb<T>
impl<T = ()> !RefUnwindSafe for SealedRingDb<T>
impl<T> Send for SealedRingDb<T>
impl<T> Sync for SealedRingDb<T>
impl<T> Unpin for SealedRingDb<T>
impl<T> UnsafeUnpin for SealedRingDb<T>
impl<T = ()> !UnwindSafe for SealedRingDb<T>
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> 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