pub struct IndexBundle { /* private fields */ }Expand description
Atomic persistence unit for mutable f32 state and an optional compact representation.
Implementations§
Source§impl IndexBundle
impl IndexBundle
Sourcepub fn new(
mutable: MutableVectorIndex,
quantized: Option<QuantizedIndex>,
) -> Result<Self, SearchError>
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.
Sourcepub const fn mutable(&self) -> &MutableVectorIndex
pub const fn mutable(&self) -> &MutableVectorIndex
Returns the mutable f32 index and its delta/metadata state.
Sourcepub const fn mutable_mut(&mut self) -> &mut MutableVectorIndex
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.
Sourcepub const fn quantized(&self) -> Option<&QuantizedIndex>
pub const fn quantized(&self) -> Option<&QuantizedIndex>
Returns the optional compact representation.
Sourcepub fn set_quantized(
&mut self,
quantized: Option<QuantizedIndex>,
) -> Result<(), SearchError>
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.
Sourcepub fn into_parts(self) -> (MutableVectorIndex, Option<QuantizedIndex>)
pub fn into_parts(self) -> (MutableVectorIndex, Option<QuantizedIndex>)
Consumes the bundle.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for IndexBundle
impl RefUnwindSafe for IndexBundle
impl Send for IndexBundle
impl Sync for IndexBundle
impl Unpin for IndexBundle
impl UnsafeUnpin for IndexBundle
impl UnwindSafe for IndexBundle
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
Mutably borrows from an owned value. Read more