pub struct HttpResponse { /* private fields */ }Implementations§
Source§impl HttpResponse
impl HttpResponse
pub fn new( status: StatusCode, headers: HeaderMap, final_url: String, body: BodyStream, ) -> Self
pub fn status(&self) -> StatusCode
pub fn headers(&self) -> &HeaderMap
pub fn url(&self) -> &str
pub fn bytes_stream(self) -> BodyStream
pub async fn bytes(self) -> Result<Bytes, HttpError>
pub async fn text(self) -> Result<String, HttpError>
pub async fn json<T: DeserializeOwned>(self) -> Result<T, HttpError>
pub fn error_for_status(self) -> Result<Self, HttpError>
Auto Trait Implementations§
impl !RefUnwindSafe for HttpResponse
impl !Sync for HttpResponse
impl !UnwindSafe for HttpResponse
impl Freeze for HttpResponse
impl Send for HttpResponse
impl Unpin for HttpResponse
impl UnsafeUnpin for HttpResponse
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