#[non_exhaustive]pub enum EmbedError {
ModelNotLoaded(String),
WrongModelLoaded {
expected: String,
actual: String,
},
ModelInitialization(String),
InferenceFailed(String),
TaskFailed(String),
InvalidInput(String),
TextTooLong {
length: usize,
max: usize,
},
DimensionMismatch {
expected: usize,
actual: usize,
},
UnsupportedModel(String),
Internal(String),
}Expand description
Stable: external consumers may depend on this; breaking changes require a SemVer bump.
Errors that can occur during embedding operations.
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.
ModelNotLoaded(String)
Model not loaded (needs initialization).
WrongModelLoaded
Wrong model loaded (concurrent model switch in progress).
This can happen when multiple tasks request different models concurrently. The caller should retry with backoff.
ModelInitialization(String)
Model initialization failed.
InferenceFailed(String)
Embedding inference failed.
TaskFailed(String)
Blocking task failed (panic or cancellation).
The model cache may be lost; next call will reinitialize.
InvalidInput(String)
Invalid input provided.
TextTooLong
Input text exceeds maximum allowed length.
DimensionMismatch
Dimension mismatch between expected and actual.
UnsupportedModel(String)
Model not supported by this service.
Internal(String)
Internal logic error (count mismatch, unexpected state).
Trait Implementations§
Source§impl Debug for EmbedError
impl Debug for EmbedError
Source§impl Display for EmbedError
impl Display for EmbedError
Source§impl Error for EmbedError
impl Error for EmbedError
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 EmbedError
impl RefUnwindSafe for EmbedError
impl Send for EmbedError
impl Sync for EmbedError
impl Unpin for EmbedError
impl UnsafeUnpin for EmbedError
impl UnwindSafe for EmbedError
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