pub enum RequestError {
InvalidUrl(String),
Refused(String),
TooLarge,
Network(Error),
}Expand description
Why a request was not answered.
Variants§
InvalidUrl(String)
The URL is not an http or https URL with a host.
Refused(String)
The URL’s host is, or resolves only to, an address the client refuses.
TooLarge
The response was larger than ClientConfig::max_response_bytes.
Network(Error)
The connection failed, timed out, or broke.
Trait Implementations§
Source§impl Debug for RequestError
impl Debug for RequestError
Source§impl Display for RequestError
impl Display for RequestError
Source§impl Error for RequestError
impl Error for RequestError
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 From<Error> for RequestError
impl From<Error> for RequestError
Source§fn from(error: Error) -> Self
fn from(error: Error) -> Self
A refusal from the resolver or a redirect comes back as
RequestError::Refused; anything else is
RequestError::Network.
Source§impl From<RequestError> for FetchError
impl From<RequestError> for FetchError
Source§fn from(error: RequestError) -> Self
fn from(error: RequestError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for RequestError
impl !UnwindSafe for RequestError
impl Freeze for RequestError
impl Send for RequestError
impl Sync for RequestError
impl Unpin for RequestError
impl UnsafeUnpin for RequestError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.