Skip to main content

FerrumError

Enum FerrumError 

Source
pub enum FerrumError {
Show 22 variants Config { message: String, }, Model { message: String, }, Tokenizer { message: String, }, Backend { message: String, }, Device { message: String, }, Scheduler { message: String, }, RequestValidation { message: String, }, ResourceExhausted { message: String, }, Timeout { message: String, }, Auth { message: String, }, RateLimit { message: String, }, IO { message: String, }, Serialization { message: String, }, Network { message: String, }, Internal { message: String, }, Cancelled { message: String, }, NotFound { message: String, }, AlreadyExists { message: String, }, PermissionDenied { message: String, }, Unsupported { message: String, }, InvalidFormat { message: String, }, InvalidParameter { message: String, },
}
Expand description

Main error type for Ferrum operations

Variants§

§

Config

Configuration errors

Fields

§message: String
§

Model

Model loading/initialization errors

Fields

§message: String
§

Tokenizer

Tokenizer errors

Fields

§message: String
§

Backend

Backend/runtime errors

Fields

§message: String
§

Device

Device/memory errors

Fields

§message: String
§

Scheduler

Scheduling/queue errors

Fields

§message: String
§

RequestValidation

Request validation errors

Fields

§message: String
§

ResourceExhausted

Resource exhaustion errors

Fields

§message: String
§

Timeout

Timeout errors

Fields

§message: String
§

Auth

Authentication/authorization errors

Fields

§message: String
§

RateLimit

Rate limiting errors

Fields

§message: String
§

IO

I/O errors

Fields

§message: String
§

Serialization

Serialization/deserialization errors

Fields

§message: String
§

Network

Network errors

Fields

§message: String
§

Internal

Internal errors (should not happen in normal operation)

Fields

§message: String
§

Cancelled

Request was cancelled

Fields

§message: String
§

NotFound

Not found errors

Fields

§message: String
§

AlreadyExists

Already exists errors

Fields

§message: String
§

PermissionDenied

Permission denied errors

Fields

§message: String
§

Unsupported

Unsupported operation errors

Fields

§message: String
§

InvalidFormat

Invalid format errors (parsing, schema mismatches)

Fields

§message: String
§

InvalidParameter

Invalid parameters or configuration values

Fields

§message: String

Implementations§

Source§

impl FerrumError

Source

pub fn config(message: impl Into<String>) -> FerrumError

Create a configuration error

Source

pub fn model(message: impl Into<String>) -> FerrumError

Create a model error

Source

pub fn tokenizer(message: impl Into<String>) -> FerrumError

Create a tokenizer error

Source

pub fn backend(message: impl Into<String>) -> FerrumError

Create a backend error

Source

pub fn device(message: impl Into<String>) -> FerrumError

Create a device error

Source

pub fn scheduler(message: impl Into<String>) -> FerrumError

Create a scheduler error

Source

pub fn request_validation(message: impl Into<String>) -> FerrumError

Create a request validation error

Source

pub fn resource_exhausted(message: impl Into<String>) -> FerrumError

Create a resource exhausted error

Source

pub fn timeout(message: impl Into<String>) -> FerrumError

Create a timeout error

Source

pub fn auth(message: impl Into<String>) -> FerrumError

Create an auth error

Source

pub fn rate_limit(message: impl Into<String>) -> FerrumError

Create a rate limit error

Source

pub fn io(message: impl Into<String>) -> FerrumError

Create an I/O error

Source

pub fn serialization(message: impl Into<String>) -> FerrumError

Create a serialization error

Source

pub fn network(message: impl Into<String>) -> FerrumError

Create a network error

Source

pub fn internal(message: impl Into<String>) -> FerrumError

Create an internal error

Source

pub fn cancelled(message: impl Into<String>) -> FerrumError

Create a cancelled error

Source

pub fn not_found(message: impl Into<String>) -> FerrumError

Create a not found error

Source

pub fn already_exists(message: impl Into<String>) -> FerrumError

Create an already exists error

Source

pub fn permission_denied(message: impl Into<String>) -> FerrumError

Create a permission denied error

Source

pub fn unsupported(message: impl Into<String>) -> FerrumError

Create an unsupported operation error

Source

pub fn invalid_format(message: impl Into<String>) -> FerrumError

Create an invalid format error (parsing/schema mismatch)

Source

pub fn invalid_parameter(message: impl Into<String>) -> FerrumError

Create an invalid parameter error

Source

pub fn io_str(message: impl Into<String>) -> FerrumError

Alias for io() - Create an I/O error from string

Source

pub fn configuration(message: impl Into<String>) -> FerrumError

Alias for config() - Create a configuration error

Source

pub fn deserialization(message: impl Into<String>) -> FerrumError

Alias for serialization() - Create a deserialization error

Source

pub fn invalid_request(message: impl Into<String>) -> FerrumError

Alias for request_validation() - Create an invalid request error

Source

pub fn is_retryable(&self) -> bool

Check if this is a retryable error

Source

pub fn is_client_error(&self) -> bool

Check if this is a client error (4xx equivalent)

Source

pub fn is_server_error(&self) -> bool

Check if this is a server error (5xx equivalent)

Trait Implementations§

Source§

impl Clone for FerrumError

Source§

fn clone(&self) -> FerrumError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FerrumError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FerrumError

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<FerrumError, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for FerrumError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Error for FerrumError

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for FerrumError

Conversion from std::io::Error

Source§

fn from(err: Error) -> FerrumError

Converts to this type from the input type.
Source§

impl From<Error> for FerrumError

Conversion from serde_json::Error

Source§

fn from(err: Error) -> FerrumError

Converts to this type from the input type.
Source§

impl Serialize for FerrumError

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,