pub struct CollectedResponse { /* private fields */ }
Expand description
A response with the body collected as bytes
Implementations§
source§impl CollectedResponse
impl CollectedResponse
sourcepub fn new(status: StatusCode, headers: Headers, body: Bytes) -> Self
pub fn new(status: StatusCode, headers: Headers, body: Bytes) -> Self
Create a new instance
sourcepub fn status(&self) -> &StatusCode
pub fn status(&self) -> &StatusCode
Get the status
sourcepub async fn from_response(response: Response) -> Result<Self>
pub async fn from_response(response: Response) -> Result<Self>
From a response
pub fn json<T>(&self) -> Result<T>where
T: DeserializeOwned,
pub fn xml<T>(&self) -> Result<T>where
T: DeserializeOwned,
Trait Implementations§
source§impl AsRef<[u8]> for CollectedResponse
impl AsRef<[u8]> for CollectedResponse
source§impl Clone for CollectedResponse
impl Clone for CollectedResponse
source§fn clone(&self) -> CollectedResponse
fn clone(&self) -> CollectedResponse
Returns a copy of the value. Read more
1.0.0 · 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 CollectedResponse
impl RefUnwindSafe for CollectedResponse
impl Send for CollectedResponse
impl Sync for CollectedResponse
impl Unpin for CollectedResponse
impl UnwindSafe for CollectedResponse
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)