pub enum HnswIndexError {
VectorDimensionMismatch {
expected: usize,
actual: usize,
},
DuplicateVectorId(u64),
VectorNotFound(u64),
IndexNotInitialized,
IndexCorrupted(String),
CapacityExceeded,
InvalidSearchParameters,
NodeNotFound(u64),
InvalidNodeId(u64),
SelfConnection(u64),
}Expand description
HNSW index operation errors
These errors occur during HNSW index operations such as insertion, search, and index maintenance.
§Error Variants
VectorDimensionMismatch- Vector length doesn’t match configured dimensionDuplicateVectorId- Attempting to insert a vector with existing IDVectorNotFound- No vector found with specified IDIndexNotInitialized- Operation attempted on uninitialized indexIndexCorrupted- Index structure is corrupted or invalid
§Examples
use sqlitegraph::hnsw::errors::HnswIndexError;
match error {
HnswIndexError::VectorDimensionMismatch { expected, actual } => {
println!("Expected {} dimensions, got {}", expected, actual);
}
HnswIndexError::DuplicateVectorId(id) => {
println!("Vector ID {} already exists", id);
}
// Handle other error types...
}Variants§
VectorDimensionMismatch
Vector dimension doesn’t match configured dimension
DuplicateVectorId(u64)
Attempt to insert duplicate vector ID
VectorNotFound(u64)
Vector ID not found in index
IndexNotInitialized
Index operation attempted on uninitialized index
IndexCorrupted(String)
Index structure corruption detected
CapacityExceeded
Index capacity exceeded
InvalidSearchParameters
Invalid search parameters
NodeNotFound(u64)
Node not found in layer
InvalidNodeId(u64)
Invalid node ID (non-sequential or out of range)
SelfConnection(u64)
Attempt to connect node to itself
Trait Implementations§
Source§impl Clone for HnswIndexError
impl Clone for HnswIndexError
Source§fn clone(&self) -> HnswIndexError
fn clone(&self) -> HnswIndexError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HnswIndexError
impl Debug for HnswIndexError
Source§impl Display for HnswIndexError
impl Display for HnswIndexError
Source§impl Error for HnswIndexError
impl Error for HnswIndexError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<HnswIndexError> for HnswError
impl From<HnswIndexError> for HnswError
Source§fn from(err: HnswIndexError) -> Self
fn from(err: HnswIndexError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for HnswIndexError
impl PartialEq for HnswIndexError
impl StructuralPartialEq for HnswIndexError
Auto Trait Implementations§
impl Freeze for HnswIndexError
impl RefUnwindSafe for HnswIndexError
impl Send for HnswIndexError
impl Sync for HnswIndexError
impl Unpin for HnswIndexError
impl UnsafeUnpin for HnswIndexError
impl UnwindSafe for HnswIndexError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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