#[non_exhaustive]pub struct HttpError(/* private fields */);Expand description
HTTP transport error reported by the underlying HTTP client.
The inner third-party error type is private; callers diagnose the failure via the accessor methods, all of which return primitive types so this crate can swap or bump the underlying HTTP client without breaking the public API.
Implementations§
Source§impl HttpError
impl HttpError
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
true if the request timed out before a response was received.
Sourcepub fn is_connect(&self) -> bool
pub fn is_connect(&self) -> bool
true if the underlying connection could not be established
(DNS failure, TCP refused, TLS handshake failure, etc.).
Sourcepub fn is_builder(&self) -> bool
pub fn is_builder(&self) -> bool
true if the error originated in the request builder
(URL parse failure, invalid header construction at build time, etc.).
Sourcepub fn is_redirect(&self) -> bool
pub fn is_redirect(&self) -> bool
true if the error is a redirect-loop or too-many-redirects failure.
Sourcepub fn is_request(&self) -> bool
pub fn is_request(&self) -> bool
true if the error happened while sending the request body.
Sourcepub fn is_body(&self) -> bool
pub fn is_body(&self) -> bool
true if the error happened while receiving / decoding the response body.
Sourcepub fn is_decode(&self) -> bool
pub fn is_decode(&self) -> bool
true if the response body could not be decoded as the requested
representation (e.g. JSON parse failure inside the transport layer).
Trait Implementations§
Source§impl Error for HttpError
impl Error for HttpError
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for HttpError
impl !RefUnwindSafe for HttpError
impl Send for HttpError
impl Sync for HttpError
impl Unpin for HttpError
impl UnsafeUnpin for HttpError
impl !UnwindSafe for HttpError
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
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt 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.