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>,
) -> 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.
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<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>,
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§fn from(e: Error) -> ModelListingError
fn from(e: Error) -> ModelListingError
Converts to this type from the input type.
Source§impl From<Error> for ModelListingError
impl From<Error> for ModelListingError
Source§fn from(e: Error) -> ModelListingError
fn from(e: Error) -> ModelListingError
Converts to this type from the input type.
Source§impl From<Error> for ModelListingError
impl From<Error> for ModelListingError
Source§fn from(e: Error) -> ModelListingError
fn from(e: Error) -> ModelListingError
Converts to this type from the input type.
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,
Serialize this value into the given Serde serializer. Read more
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> 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>
impl<T> DebuggableStorage for T
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> 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> 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.