pub enum ModelListingError {
ApiError {
status_code: u16,
message: String,
},
RequestError {
message: String,
},
ParseError {
message: String,
},
AuthError {
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.)
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.
Trait Implementations§
Source§impl Clone for ModelListingError
impl Clone for ModelListingError
Source§fn clone(&self) -> ModelListingError
fn clone(&self) -> ModelListingError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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>,
Deserialize this value from the given Serde deserializer. Read more
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)>
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()
Source§impl From<Error> for ModelListingError
impl From<Error> for ModelListingError
Source§impl From<Error> for ModelListingError
impl From<Error> for ModelListingError
Source§impl From<Error> for ModelListingError
impl From<Error> for ModelListingError
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
Converts
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> ⓘ
Converts
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> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
Convert this value without routing structured data through a string.
Source§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,
impl<T> Read<Exclusive, BecauseExclusive> 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.