#[non_exhaustive]pub enum HttpClientError {
Build(Error),
InvalidRequest(Error),
Connect(Error),
Timeout(Error),
Redirect(Error),
Decode(Error),
Io(Error),
Other(Error),
}Expand description
An error produced while preparing or executing an HTTP request.
§Examples
use millipede_core::http_client::HttpClientError;
let error = HttpClientError::timeout(anyhow::anyhow!("deadline elapsed"));
assert!(error.is_timeout());
assert!(!error.is_connect());Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Build(Error)
The HTTP client could not be built.
InvalidRequest(Error)
The request was invalid.
Connect(Error)
The remote endpoint could not be connected to.
Timeout(Error)
The request timed out.
Redirect(Error)
Redirect processing failed.
Decode(Error)
The response could not be decoded.
Io(Error)
An input/output operation failed.
Other(Error)
Another HTTP client error occurred.
Implementations§
Source§impl HttpClientError
impl HttpClientError
Sourcepub fn is_connect(&self) -> bool
pub fn is_connect(&self) -> bool
Returns whether this error represents a connection failure.
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Returns whether this error represents a timeout.
Sourcepub fn invalid_request(error: impl Into<Error>) -> Self
pub fn invalid_request(error: impl Into<Error>) -> Self
Creates an invalid-request error.
Trait Implementations§
Source§impl Debug for HttpClientError
impl Debug for HttpClientError
Source§impl Display for HttpClientError
impl Display for HttpClientError
Source§impl Error for HttpClientError
impl Error for HttpClientError
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()
Auto Trait Implementations§
impl Freeze for HttpClientError
impl RefUnwindSafe for HttpClientError
impl Send for HttpClientError
impl Sync for HttpClientError
impl Unpin for HttpClientError
impl UnsafeUnpin for HttpClientError
impl UnwindSafe for HttpClientError
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