Skip to main content

IndexBundle

Struct IndexBundle 

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

Atomic persistence unit for mutable f32 state and an optional compact representation.

Implementations§

Source§

impl IndexBundle

Source

pub fn new( mutable: MutableVectorIndex, quantized: Option<QuantizedIndex>, ) -> Result<Self, SearchError>

Creates a validated bundle.

§Errors

Returns an error when the compact representation does not describe the same active key set and configuration as the mutable index.

Source

pub const fn mutable(&self) -> &MutableVectorIndex

Returns the mutable f32 index and its delta/metadata state.

Source

pub const fn mutable_mut(&mut self) -> &mut MutableVectorIndex

Returns mutable access to the f32 index.

Callers replacing active vectors must also replace or remove the compact representation before saving.

Source

pub const fn quantized(&self) -> Option<&QuantizedIndex>

Returns the optional compact representation.

Source

pub fn set_quantized( &mut self, quantized: Option<QuantizedIndex>, ) -> Result<(), SearchError>

Replaces the compact representation after validating bundle identity.

§Errors

Returns an error when config or active keys differ.

Source

pub fn into_parts(self) -> (MutableVectorIndex, Option<QuantizedIndex>)

Consumes the bundle.

Source

pub fn save(&self, path: impl AsRef<Path>) -> Result<(), SearchError>

Atomically saves vectors, graphs, mutation delta, metadata, and compact representation under one checksum.

§Errors

Returns a consistency, serialization, or filesystem error.

Source

pub fn load(path: impl AsRef<Path>) -> Result<Self, SearchError>

Loads and validates a complete bundle.

§Errors

Returns a filesystem, integrity, format, or consistency error.

Trait Implementations§

Source§

impl Debug for IndexBundle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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.