#[non_exhaustive]pub enum HttpFetchError {
Request {
source: Error,
},
Status {
status: StatusCode,
},
Body {
source: Error,
},
}Expand description
Transport-layer failure exposed by HttpFetcher.
HttpFetchError is what the boxed source of LoaderError::Fetch
carries when produced by this crate. Downstream code that needs the
structured detail (e.g. a status-code-specific retry) can downcast via
std::error::Error::source and downcast_ref::<HttpFetchError>().
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.
Request
The underlying request could not be dispatched: DNS lookup failed, the connection was refused, the request timed out, etc.
Status
The server returned a non-success status code.
Fields
§
status: StatusCodeBody
The response headers came back fine but the body could not be read.
Trait Implementations§
Source§impl Debug for HttpFetchError
impl Debug for HttpFetchError
Source§impl Display for HttpFetchError
impl Display for HttpFetchError
Source§impl Error for HttpFetchError
impl Error for HttpFetchError
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 HttpFetchError
impl !RefUnwindSafe for HttpFetchError
impl Send for HttpFetchError
impl Sync for HttpFetchError
impl Unpin for HttpFetchError
impl UnsafeUnpin for HttpFetchError
impl !UnwindSafe for HttpFetchError
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