pub struct Response<'buf, 'conn, C>where
C: Read,{
pub status: Status,
pub content_type: Option<ContentType>,
pub content_length: Option<usize>,
pub transfer_encoding: Vec<TransferEncoding, 4>,
pub keep_alive: Option<KeepAlive>,
/* private fields */
}Expand description
Type representing a parsed HTTP response.
Fields§
§status: StatusThe HTTP response status code.
content_type: Option<ContentType>The HTTP response content type.
content_length: Option<usize>The content length.
transfer_encoding: Vec<TransferEncoding, 4>The transfer encoding.
keep_alive: Option<KeepAlive>The keep-alive parameters.
Implementations§
source§impl<'buf, 'conn, C> Response<'buf, 'conn, C>where
C: Read,
impl<'buf, 'conn, C> Response<'buf, 'conn, C>where
C: Read,
pub async fn read( conn: &'conn mut C, method: Method, header_buf: &'buf mut [u8] ) -> Result<Response<'buf, 'conn, C>, Error>
sourcepub fn headers(&self) -> HeaderIterator<'_> ⓘ
pub fn headers(&self) -> HeaderIterator<'_> ⓘ
Get the response headers
sourcepub fn body(self) -> ResponseBody<'buf, 'conn, C>
pub fn body(self) -> ResponseBody<'buf, 'conn, C>
Get the response body
Trait Implementations§
Auto Trait Implementations§
impl<'buf, 'conn, C> RefUnwindSafe for Response<'buf, 'conn, C>where
C: RefUnwindSafe,
impl<'buf, 'conn, C> Send for Response<'buf, 'conn, C>where
C: Send,
impl<'buf, 'conn, C> Sync for Response<'buf, 'conn, C>where
C: Sync,
impl<'buf, 'conn, C> Unpin for Response<'buf, 'conn, C>
impl<'buf, 'conn, C> !UnwindSafe for Response<'buf, 'conn, C>
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