pub struct Response { /* private fields */ }Expand description
Fully buffered HTTP response body and metadata.
Implementations§
Source§impl Response
impl Response
Sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
Returns the HTTP status code.
Sourcepub fn text_lossy(&self) -> String
pub fn text_lossy(&self) -> String
Decodes the buffered body as lossy UTF-8 text.
Sourcepub fn json<T>(&self) -> Result<T>where
T: DeserializeOwned,
pub fn json<T>(&self) -> Result<T>where
T: DeserializeOwned,
Deserializes the buffered body from JSON.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
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