#[non_exhaustive]pub enum EmbeddingError {
HttpError(String),
ApiError(String),
ParseError(String),
Config(String),
EmptyInput,
BatchMismatch {
expected: usize,
actual: usize,
},
EmptyVectorInBatch,
}Expand description
Embedding error type
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
HttpError(String)
HTTP request error
ApiError(String)
API error
ParseError(String)
Parse error
Config(String)
Configuration error (e.g. empty API key, unknown model dimension) — fails fast at construction.
EmptyInput
Empty input
BatchMismatch
Batch embedding misalignment: for N requested texts, the provider returned a vector count or index outside the expected range (a chunk missing entries / out of order).
P0-1: reject silently misaligned data — never treat a missing vector as “dissimilar”.
Fields
EmptyVectorInBatch
Some text in a batch got no vector (the provider returned fewer embeddings than requested).
P0-1: reject silently empty vectors — a missing vector is an explicit error, not a zero vector.
Trait Implementations§
Source§impl Debug for EmbeddingError
impl Debug for EmbeddingError
Source§impl Display for EmbeddingError
impl Display for EmbeddingError
Source§impl Error for EmbeddingError
impl Error for EmbeddingError
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()
Auto Trait Implementations§
impl Freeze for EmbeddingError
impl RefUnwindSafe for EmbeddingError
impl Send for EmbeddingError
impl Sync for EmbeddingError
impl Unpin for EmbeddingError
impl UnsafeUnpin for EmbeddingError
impl UnwindSafe for EmbeddingError
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