pub enum NetworkError {
HttpError {
status: u16,
message: String,
},
Timeout {
timeout: Duration,
},
ConnectionFailed {
message: String,
},
DnsError {
host: String,
},
TlsError {
message: String,
},
}
Expand description
Common network errors.
Variants§
HttpError
HTTP request failed
Timeout
Connection timeout
ConnectionFailed
Connection failed
DnsError
DNS resolution failed
TlsError
TLS/SSL error
Implementations§
Source§impl NetworkError
impl NetworkError
Sourcepub fn http_error(status: u16, message: impl Into<String>) -> NetworkError
pub fn http_error(status: u16, message: impl Into<String>) -> NetworkError
Create an HTTP error
Sourcepub fn timeout(timeout: Duration) -> NetworkError
pub fn timeout(timeout: Duration) -> NetworkError
Create a timeout error
Sourcepub fn connection_failed(message: impl Into<String>) -> NetworkError
pub fn connection_failed(message: impl Into<String>) -> NetworkError
Create a connection failed error
Sourcepub fn dns_error(host: impl Into<String>) -> NetworkError
pub fn dns_error(host: impl Into<String>) -> NetworkError
Create a DNS error
Sourcepub fn tls_error(message: impl Into<String>) -> NetworkError
pub fn tls_error(message: impl Into<String>) -> NetworkError
Create a TLS error
Trait Implementations§
Source§impl Debug for NetworkError
impl Debug for NetworkError
Source§impl Display for NetworkError
impl Display for NetworkError
Source§impl Error for NetworkError
impl Error for NetworkError
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<E> From<NetworkError> for LlmError<E>where
E: ProviderError,
impl<E> From<NetworkError> for LlmError<E>where
E: ProviderError,
Source§fn from(source: NetworkError) -> LlmError<E>
fn from(source: NetworkError) -> LlmError<E>
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NetworkError
impl RefUnwindSafe for NetworkError
impl Send for NetworkError
impl Sync for NetworkError
impl Unpin for NetworkError
impl UnwindSafe for NetworkError
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