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>,
) -> ModelListingError
pub fn api_error( status_code: u16, message: impl Into<String>, ) -> ModelListingError
Creates a new ApiError with the given status code and message.
Sourcepub fn request_error(message: impl Into<String>) -> ModelListingError
pub fn request_error(message: impl Into<String>) -> ModelListingError
Creates a new RequestError with the given message.
Sourcepub fn parse_error(message: impl Into<String>) -> ModelListingError
pub fn parse_error(message: impl Into<String>) -> ModelListingError
Creates a new ParseError with the given message.
Sourcepub fn auth_error(message: impl Into<String>) -> ModelListingError
pub fn auth_error(message: impl Into<String>) -> ModelListingError
Creates a new AuthError with the given message.
Sourcepub fn rate_limit_error(message: impl Into<String>) -> ModelListingError
pub fn rate_limit_error(message: impl Into<String>) -> ModelListingError
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>) -> ModelListingError
pub fn unknown_error(message: impl Into<String>) -> ModelListingError
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<ModelListingError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModelListingError, <__D as Deserializer<'de>>::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
Source§impl Serialize for ModelListingError
impl Serialize for ModelListingError
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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.