pub struct ClientResponse {
pub status: Status,
pub headers: Headers,
pub body: Vec<u8>,
}Expand description
A response from an outbound request.
Fields§
§status: Status§headers: Headers§body: Vec<u8>Implementations§
Source§impl ClientResponse
impl ClientResponse
pub fn text(&self) -> String
pub fn json(&self) -> Result<Json>
pub fn is_success(&self) -> bool
Sourcepub fn error_for_status(self) -> Result<ClientResponse>
pub fn error_for_status(self) -> Result<ClientResponse>
Turn a non-2xx response into an error, keeping the body — an API’s error message is usually the only thing that explains the failure.
Trait Implementations§
Source§impl Clone for ClientResponse
impl Clone for ClientResponse
Source§fn clone(&self) -> ClientResponse
fn clone(&self) -> ClientResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ClientResponse
impl RefUnwindSafe for ClientResponse
impl Send for ClientResponse
impl Sync for ClientResponse
impl Unpin for ClientResponse
impl UnsafeUnpin for ClientResponse
impl UnwindSafe for ClientResponse
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