#[non_exhaustive]pub enum EvalError {
Io {
path: PathBuf,
source: Error,
},
Parse {
path: PathBuf,
reason: &'static str,
},
DimensionMismatch {
expected: usize,
found: usize,
},
LengthMismatch {
kind: &'static str,
expected: usize,
found: usize,
},
KExceedsCorpus {
k: usize,
corpus_size: usize,
},
EmptyInput {
kind: &'static str,
},
Search(IqdbError),
UnsupportedVectorId {
found: &'static str,
},
}Expand description
An error from an iqdb-eval measurement or dataset-loading 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_eval::EvalError;
let err = EvalError::DimensionMismatch { expected: 128, found: 64 };
assert_eq!(
err.to_string(),
"vector dimension mismatch: expected 128, found 64",
);
let err = EvalError::KExceedsCorpus { k: 100, corpus_size: 10 };
assert_eq!(
err.to_string(),
"k exceeds corpus size: k=100, corpus_size=10",
);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
An OS-level I/O failure occurred while reading a dataset file.
path is the file whose read failed; source is the underlying
std::io::Error and is reachable via std::error::Error::source.
Fields
Parse
A dataset file was opened successfully but its contents could not
be parsed (truncated record, invalid header, etc.). reason is a
short static description of the parser check that failed.
Fields
DimensionMismatch
A vector did not have the dimensionality the operation required.
expected is what was required; found is what was supplied.
Fields
LengthMismatch
Two collections that had to share a length did not. kind names
the pair (e.g. "queries vs ground_truth"); expected is the
first collection’s length; found is the second’s.
Fields
KExceedsCorpus
The requested k exceeds the corpus size, so a k-nearest result
cannot be returned.
Fields
EmptyInput
A required input collection was empty. kind names the collection
(e.g. "queries", "base", "ground_truth").
Search(IqdbError)
A nested IqdbError surfaced from a downstream IndexCore
operation (typically iqdb_index::IndexCore::insert or
iqdb_index::IndexCore::search).
UnsupportedVectorId
A VectorId shape that the harness cannot project to a u32
row-index was encountered while computing ground truth. The
convention is documented on crate::build_index_from_base:
callers must insert each base row at VectorId::U64(row_index).
found is a short static identifier for the variant that was
actually returned (for example, "VectorId::Bytes").
Trait Implementations§
Source§impl Error for EvalError
impl Error for EvalError
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()