pub enum Error {
InvalidUrl,
DnsError(Error),
IpAddressEmpty,
ConnectionError(ConnectError),
TcpError(Error),
NoResponse,
InvalidResponse(&'static str),
UnsupportedScheme(&'static str),
HeaderError(&'static str),
InvalidStatusCode,
}Expand description
Errors that can occur during HTTP operations
This enum represents all possible errors that can be returned by the HTTP client during various stages of request processing, from URL parsing to connection establishment and response handling. All possible errors returned by the HTTP client.
Variants§
InvalidUrl
The provided URL was invalid or malformed
DnsError(Error)
DNS resolution failed
IpAddressEmpty
No IP addresses were returned by DNS resolution
ConnectionError(ConnectError)
Failed to establish a TCP connection
TcpError(Error)
TCP communication error
NoResponse
No response was received from the server
InvalidResponse(&'static str)
The server’s response could not be parsed
UnsupportedScheme(&'static str)
Scheme not supported
HeaderError(&'static str)
Header error, e.g. too long name or value
InvalidStatusCode
Invalid status code received from the server
Trait Implementations§
Source§impl From<ConnectError> for Error
impl From<ConnectError> for Error
Source§fn from(err: ConnectError) -> Self
fn from(err: ConnectError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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