pub struct OnlineIndex<T> { /* private fields */ }Expand description
Wrapper that adds online update capabilities to any index
Implementations§
Source§impl<T> OnlineIndex<T>
impl<T> OnlineIndex<T>
Sourcepub fn new(inner: T, config: OnlineUpdateConfig) -> Self
pub fn new(inner: T, config: OnlineUpdateConfig) -> Self
Create a new online-updatable index wrapper
Sourcepub fn read(&self) -> RwLockReadGuard<'_, T>
pub fn read(&self) -> RwLockReadGuard<'_, T>
Get read access to the inner index
Sourcepub fn write(&self) -> RwLockWriteGuard<'_, T>
pub fn write(&self) -> RwLockWriteGuard<'_, T>
Get write access to the inner index
Sourcepub fn is_deleted(&self, id: &VectorId) -> bool
pub fn is_deleted(&self, id: &VectorId) -> bool
Check if a vector ID is deleted
Sourcepub fn mark_deleted(&self, id: VectorId) -> bool
pub fn mark_deleted(&self, id: VectorId) -> bool
Mark a vector as deleted
Sourcepub fn clear_deleted(&self, ids: &[VectorId])
pub fn clear_deleted(&self, ids: &[VectorId])
Clear deleted marks after cleanup
Sourcepub fn pending_deletes(&self) -> usize
pub fn pending_deletes(&self) -> usize
Get number of pending deletes
Sourcepub fn needs_maintenance(&self) -> bool
pub fn needs_maintenance(&self) -> bool
Check if maintenance is needed
Sourcepub fn record_insert(&self)
pub fn record_insert(&self)
Record an insert
Sourcepub fn record_update(&self)
pub fn record_update(&self)
Record an update
Sourcepub fn stats(&self) -> OnlineUpdateStats
pub fn stats(&self) -> OnlineUpdateStats
Get statistics
Sourcepub fn store_vector(&self, id: VectorId, vector: Vec<f32>)
pub fn store_vector(&self, id: VectorId, vector: Vec<f32>)
Store vector for potential retrieval
Sourcepub fn has_vector(&self, id: &VectorId) -> bool
pub fn has_vector(&self, id: &VectorId) -> bool
Check if vector exists in storage
Sourcepub fn vector_count(&self) -> usize
pub fn vector_count(&self) -> usize
Get vector count (excluding deleted)
Auto Trait Implementations§
impl<T> !Freeze for OnlineIndex<T>
impl<T> RefUnwindSafe for OnlineIndex<T>
impl<T> Send for OnlineIndex<T>
impl<T> Sync for OnlineIndex<T>
impl<T> Unpin for OnlineIndex<T>
impl<T> UnsafeUnpin for OnlineIndex<T>
impl<T> UnwindSafe for OnlineIndex<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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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