pub enum VectorError {
ExtensionNotInstalled,
DimensionMismatch {
expected: usize,
actual: usize,
},
EmptyVector,
InvalidDimensions(String),
Index(String),
Postgres(PgError),
Query(String),
TypeConversion(String),
Config(String),
}Expand description
Errors that can occur during pgvector operations.
Variants§
ExtensionNotInstalled
The pgvector extension is not installed.
DimensionMismatch
Dimension mismatch between vectors.
EmptyVector
Empty vector provided.
InvalidDimensions(String)
Invalid dimensions for an operation.
Index(String)
Index creation error.
Postgres(PgError)
PostgreSQL error.
Query(String)
Query execution error.
TypeConversion(String)
Type conversion error.
Config(String)
Configuration error.
Implementations§
Source§impl VectorError
impl VectorError
Sourcepub fn dimension_mismatch(expected: usize, actual: usize) -> Self
pub fn dimension_mismatch(expected: usize, actual: usize) -> Self
Create a dimension mismatch error.
Sourcepub fn type_conversion(message: impl Into<String>) -> Self
pub fn type_conversion(message: impl Into<String>) -> Self
Create a type conversion error.
Sourcepub fn is_dimension_mismatch(&self) -> bool
pub fn is_dimension_mismatch(&self) -> bool
Check if this is a dimension mismatch error.
Sourcepub fn is_extension_not_installed(&self) -> bool
pub fn is_extension_not_installed(&self) -> bool
Check if this is an extension not installed 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)>
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<PgError> for VectorError
impl From<PgError> for VectorError
Source§impl From<VectorError> for QueryError
impl From<VectorError> for QueryError
Source§fn from(err: VectorError) -> Self
fn from(err: VectorError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for VectorError
impl !RefUnwindSafe for VectorError
impl Send for VectorError
impl Sync for VectorError
impl Unpin for VectorError
impl UnsafeUnpin 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
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<E> IntoQueryError for E
impl<E> IntoQueryError for E
Source§fn into_query_error(self) -> QueryError
fn into_query_error(self) -> QueryError
Convert to a QueryError.