pub enum VectorError {
Show 18 variants
DimensionMismatch {
expected: usize,
got: usize,
},
DuplicateId(EmbeddingId),
NotFound(EmbeddingId),
CapacityExceeded {
max: usize,
current: usize,
},
InvalidVector(String),
ConfigError(ConfigValidationError),
EmptyIndex,
SerializationError(String),
IoError(Error),
FileNotFound(PathBuf),
CorruptedFile(String),
LockError(String),
Timeout(u64),
NotInitialized,
ConcurrentModification,
GraphError(String),
InvalidSearchParams(String),
Internal(String),
}Expand description
Main error type for vector operations.
Variants§
DimensionMismatch
Dimension mismatch between vector and index.
Fields
DuplicateId(EmbeddingId)
Vector with this ID already exists.
NotFound(EmbeddingId)
Vector with this ID was not found.
CapacityExceeded
Index capacity exceeded.
InvalidVector(String)
Invalid vector data (e.g., contains NaN or Inf).
ConfigError(ConfigValidationError)
Configuration error.
EmptyIndex
Index is empty.
SerializationError(String)
Serialization error.
IoError(Error)
IO error during persistence.
FileNotFound(PathBuf)
File not found.
CorruptedFile(String)
Corrupted index file.
LockError(String)
Lock acquisition failed.
Timeout(u64)
Operation timeout.
NotInitialized
Index not initialized.
ConcurrentModification
Concurrent modification detected.
GraphError(String)
Graph operation error.
InvalidSearchParams(String)
Search parameters invalid.
Internal(String)
Internal error (should not happen in normal operation).
Implementations§
Source§impl VectorError
impl VectorError
Sourcepub fn dimension_mismatch(expected: usize, got: usize) -> Self
pub fn dimension_mismatch(expected: usize, got: usize) -> Self
Create a dimension mismatch error.
Sourcepub fn capacity_exceeded(max: usize, current: usize) -> Self
pub fn capacity_exceeded(max: usize, current: usize) -> Self
Create a capacity exceeded error.
Sourcepub fn invalid_vector(msg: impl Into<String>) -> Self
pub fn invalid_vector(msg: impl Into<String>) -> Self
Create an invalid vector error.
Sourcepub fn serialization(msg: impl Into<String>) -> Self
pub fn serialization(msg: impl Into<String>) -> Self
Create a serialization error.
Sourcepub fn invalid_search(msg: impl Into<String>) -> Self
pub fn invalid_search(msg: impl Into<String>) -> Self
Create an invalid search params error.
Sourcepub fn is_retriable(&self) -> bool
pub fn is_retriable(&self) -> bool
Check if this is a retriable error.
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Check if this is a not-found error.
Trait Implementations§
Source§impl Debug for VectorError
impl Debug for VectorError
Source§impl Display for VectorError
impl Display for VectorError
Source§impl Error for VectorError
impl Error for VectorError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<ConfigValidationError> for VectorError
impl From<ConfigValidationError> for VectorError
Source§fn from(source: ConfigValidationError) -> Self
fn from(source: ConfigValidationError) -> Self
Source§impl From<Error> for VectorError
impl From<Error> for VectorError
Auto Trait Implementations§
impl Freeze for VectorError
impl !RefUnwindSafe for VectorError
impl Send for VectorError
impl Sync for VectorError
impl Unpin for VectorError
impl !UnwindSafe for VectorError
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> 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>
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