pub struct Error { /* private fields */ }Expand description
An error building a request, sending it, or reading the response body.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_builder(&self) -> bool
pub fn is_builder(&self) -> bool
The request could not be built: an invalid URL, header, or body.
Sourcepub fn is_request(&self) -> bool
pub fn is_request(&self) -> bool
The service failed to send the request or to receive a response: connection refused, a timeout layer gave up,
and so on. Error::source is the service’s error.
Sourcepub fn is_io(&self) -> bool
pub fn is_io(&self) -> bool
A file could not be read or written: an Upload whose file is missing, or
Response::save_to failing to write. Error::source
is the std::io::Error.
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Whether the request timed out: a reqwest timeout, tower’s timeout layer, or an
idle_timeout of server-sent events.
Sourcepub fn is_connect(&self) -> bool
pub fn is_connect(&self) -> bool
Whether connecting to the server failed (only known for reqwest, and not on WebAssembly, where fetch does not
tell).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + '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 !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Forget for Error
impl Freeze for Error
impl Move for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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