#[non_exhaustive]pub enum IqdbError {
DimensionMismatch {
expected: usize,
found: usize,
},
InvalidVector,
InvalidConfig {
reason: &'static str,
},
NotFound,
Duplicate,
InvalidMetric,
InvalidFilter,
ResourceLimitExceeded {
kind: &'static str,
max: usize,
found: usize,
},
}Expand description
An error from an iqdb vector-database operation.
Each variant identifies one specific failure. The enum is
#[non_exhaustive]: future releases may add variants without it being a
breaking change, so a match on it must include a wildcard arm.
§Examples
use iqdb_types::IqdbError;
let err = IqdbError::DimensionMismatch { expected: 3, found: 2 };
assert_eq!(
err.to_string(),
"vector dimension mismatch: expected 3, found 2",
);
let cfg = IqdbError::InvalidConfig { reason: "dim must be greater than zero" };
assert_eq!(
cfg.to_string(),
"invalid configuration: dim must be greater than zero",
);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DimensionMismatch
A vector did not have the dimensionality the operation required —
expected is the index’s dimension, found is what was supplied.
Fields
InvalidVector
A vector was not valid for the operation (for example, empty when a non-empty vector was required).
InvalidConfig
A configuration value could not describe a working index or query.
reason is a short static description of which configuration check
failed, suitable for inclusion in operator-facing logs.
NotFound
The requested id or record does not exist.
Duplicate
An insert collided with an id that is already present.
InvalidMetric
The distance metric was not valid for the operation or the vectors.
InvalidFilter
A filter expression was malformed or could not be evaluated.
ResourceLimitExceeded
An incoming write exceeded a configured resource limit. kind names
which cap was hit (one of "id_bytes", "metadata_keys",
"metadata_key_bytes", "metadata_value_string_bytes",
"total_vectors"); max is the cap; found is what the caller
supplied. Surfaces from the Database write boundary; the
type-level constructors in this crate never produce it.
Trait Implementations§
impl Copy for IqdbError
impl Eq for IqdbError
Source§impl Error for IqdbError
impl Error for IqdbError
1.30.0 · 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
use the Display impl or to_string()