pub enum EmbedderError {
Download {
model: String,
source: String,
},
CacheUnwritable {
source: String,
},
Load {
model: String,
source: String,
},
Inference {
source: String,
},
EmbeddingsNotBuilt,
DimensionMismatch {
expected: usize,
got: usize,
model: String,
},
ModelMismatch {
built: String,
active: String,
},
Config {
message: String,
},
NotCached {
model: String,
revision: Option<String>,
},
}Expand description
A recoverable embedder failure. Returned instead of panicking so a load or
inference problem surfaces to the SDK as a catchable error (with a
remediation hint in Display) rather than aborting the host process.
Variants§
Download
A configured embedding source could not be reached: offline, DNS/TLS, timeout, or an endpoint/model request returned a 4xx.
Fields
CacheUnwritable
The HuggingFace cache could not be written: permissions, disk full, or a read-only filesystem.
Load
Model files are unusable: missing or corrupt weights, or a config/tokenizer that failed to parse.
Fields
Inference
Embedding a specific text failed (tokenization or the forward pass).
EmbeddingsNotBuilt
A semantic/hybrid search was requested but the embedding cache is not
built for the current corpus — build_embeddings was never run. No model
is loaded; the caller must build the embeddings first.
DimensionMismatch
A vector’s dimension does not match the embedding cache’s. Cosine over mismatched dimensions is silently wrong, so this is a hard error — raised when a query (or an endpoint’s response) has a different width than the vectors the cache was built with.
Fields
ModelMismatch
A vector was produced by a different resolved model than the vectors already in the cache. Mixing vector spaces is never safe; callers must explicitly rebuild the full corpus to adopt the active model.
Fields
Config
The embedding configuration is invalid — a bad source combination, a
missing required field, or a named api_key_env that is not set. Surfaced
at catalog construction or on first use.
NotCached
An explicitly-configured HuggingFace model is not in the local cache, and Ratel auto-downloads only the built-in default. The user must fetch it first — symmetric with Ollama’s “model not pulled”.
Trait Implementations§
Source§impl Clone for EmbedderError
impl Clone for EmbedderError
Source§fn clone(&self) -> EmbedderError
fn clone(&self) -> EmbedderError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EmbedderError
impl Debug for EmbedderError
Source§impl Display for EmbedderError
impl Display for EmbedderError
Source§impl Error for EmbedderError
impl Error for EmbedderError
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()
Auto Trait Implementations§
impl Freeze for EmbedderError
impl RefUnwindSafe for EmbedderError
impl Send for EmbedderError
impl Sync for EmbedderError
impl Unpin for EmbedderError
impl UnsafeUnpin for EmbedderError
impl UnwindSafe for EmbedderError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more