pub struct ResponseError { /* private fields */ }Expand description
A request to a URI that was expected to return successfully with 200 OK has failed to do so. This contains the status code that was received instead, and the bytes in the body of the response.
Implementations§
Source§impl ResponseError
impl ResponseError
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Consume this error, taking out the body bytes of the response.
Sourcepub fn into_uri_bytes(self) -> (Url, Vec<u8>)
pub fn into_uri_bytes(self) -> (Url, Vec<u8>)
Consume this error, taking out both the URI of the request, and the body bytes of the response.
Source§impl ResponseError
impl ResponseError
Sourcepub fn status_code(&self) -> StatusCode
pub fn status_code(&self) -> StatusCode
Copy of the response’s status code.
Trait Implementations§
Source§impl Debug for ResponseError
impl Debug for ResponseError
Source§impl Display for ResponseError
impl Display for ResponseError
Source§impl Error for ResponseError
impl Error for ResponseError
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()
Auto Trait Implementations§
impl Freeze for ResponseError
impl RefUnwindSafe for ResponseError
impl Send for ResponseError
impl Sync for ResponseError
impl Unpin for ResponseError
impl UnwindSafe for ResponseError
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