pub enum ModelListingError {
ApiError {
status_code: u16,
message: String,
},
RequestError {
message: String,
},
ParseError {
message: String,
},
AuthError {
message: String,
},
RateLimitError {
message: String,
},
ServiceUnavailable {
message: String,
},
UnknownError {
message: String,
},
}Expand description
Errors that can occur when listing models from a provider.
This enum represents the various error conditions that may arise when attempting to retrieve the list of available models from an LLM provider.
Variants§
ApiError
The provider returned an error response with a status code
RequestError
Failed to send the request to the provider
ParseError
Failed to parse the provider’s response
AuthError
Authentication failed (invalid API key, etc.)
RateLimitError
Rate limit was exceeded
The provider service is temporarily unavailable
UnknownError
An unexpected error occurred
Implementations§
Source§impl ModelListingError
impl ModelListingError
Sourcepub fn api_error(status_code: u16, message: impl Into<String>) -> Self
pub fn api_error(status_code: u16, message: impl Into<String>) -> Self
Creates a new ApiError with the given status code and message.
Sourcepub fn request_error(message: impl Into<String>) -> Self
pub fn request_error(message: impl Into<String>) -> Self
Creates a new RequestError with the given message.
Sourcepub fn parse_error(message: impl Into<String>) -> Self
pub fn parse_error(message: impl Into<String>) -> Self
Creates a new ParseError with the given message.
Sourcepub fn auth_error(message: impl Into<String>) -> Self
pub fn auth_error(message: impl Into<String>) -> Self
Creates a new AuthError with the given message.
Sourcepub fn rate_limit_error(message: impl Into<String>) -> Self
pub fn rate_limit_error(message: impl Into<String>) -> Self
Creates a new RateLimitError with the given message.
Creates a new ServiceUnavailable error with the given message.
Sourcepub fn unknown_error(message: impl Into<String>) -> Self
pub fn unknown_error(message: impl Into<String>) -> Self
Creates a new UnknownError with the given message.
Trait Implementations§
Source§impl Clone for ModelListingError
impl Clone for ModelListingError
Source§fn clone(&self) -> ModelListingError
fn clone(&self) -> ModelListingError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModelListingError
impl Debug for ModelListingError
Source§impl<'de> Deserialize<'de> for ModelListingError
impl<'de> Deserialize<'de> for ModelListingError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ModelListingError
impl Display for ModelListingError
Source§impl Error for ModelListingError
impl Error for ModelListingError
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
Auto Trait Implementations§
impl Freeze for ModelListingError
impl RefUnwindSafe for ModelListingError
impl Send for ModelListingError
impl Sync for ModelListingError
impl Unpin for ModelListingError
impl UnsafeUnpin for ModelListingError
impl UnwindSafe for ModelListingError
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> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.