pub enum Error {
Show 13 variants
ModelNotFound {
model_id: String,
},
UnsupportedArchitecture {
architecture: String,
},
OutOfMemory {
requested: usize,
available: usize,
},
ContextLengthExceeded {
current: u32,
max: u32,
},
InvalidConfig {
message: String,
},
Backend {
backend: String,
message: String,
},
Timeout {
duration: Duration,
},
RateLimited {
retry_after: Duration,
},
Tokenization {
message: String,
},
ModelLoad {
message: String,
},
Io(Error),
Serialization(Error),
Internal {
message: String,
},
}Expand description
Unified error type for the Infernum ecosystem.
Variants§
ModelNotFound
Model was not found in the registry.
UnsupportedArchitecture
Model architecture is not supported.
OutOfMemory
Out of memory during inference.
ContextLengthExceeded
Context length exceeded for the model.
InvalidConfig
Invalid configuration provided.
Backend
Backend-specific error.
Timeout
Operation timed out.
RateLimited
Rate limited by the system.
Tokenization
Tokenization error.
ModelLoad
Model loading error.
Io(Error)
I/O error.
Serialization(Error)
Serialization error.
Internal
Internal error (unexpected state).
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true if this error is retryable.
Sourcepub fn is_resource_exhaustion(&self) -> bool
pub fn is_resource_exhaustion(&self) -> bool
Returns true if this error is due to resource exhaustion.
Sourcepub fn internal(message: impl Into<String>) -> Self
pub fn internal(message: impl Into<String>) -> Self
Creates an internal error with the given message.
Sourcepub fn backend(backend: impl Into<String>, message: impl Into<String>) -> Self
pub fn backend(backend: impl Into<String>, message: impl Into<String>) -> Self
Creates a backend error with the given backend name and message.
Sourcepub fn model_load(message: impl Into<String>) -> Self
pub fn model_load(message: impl Into<String>) -> Self
Creates a model load error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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