pub struct ResponseBody<'resp, 'buf, C>where
C: Read,{
pub body_buf: &'buf mut [u8],
/* private fields */
}Expand description
Response body
This type contains the original header buffer provided to read_headers,
now renamed to body_buf, the number of read body bytes that are available
in body_buf, and a reader to be used for reading the remaining body.
Fields§
§body_buf: &'buf mut [u8]The buffer initially provided to read the header.
Implementations§
Source§impl<'resp, 'buf, C> ResponseBody<'resp, 'buf, C>where
C: Read,
impl<'resp, 'buf, C> ResponseBody<'resp, 'buf, C>where
C: Read,
pub fn reader(self) -> BodyReader<BufferingReader<'resp, 'buf, C>>
Source§impl<'resp, 'buf, C> ResponseBody<'resp, 'buf, C>where
C: Read + TryBufRead,
impl<'resp, 'buf, C> ResponseBody<'resp, 'buf, C>where
C: Read + TryBufRead,
Sourcepub async fn read_to_end(self) -> Result<&'buf mut [u8], Error>
pub async fn read_to_end(self) -> Result<&'buf mut [u8], Error>
Read the entire body into the buffer originally provided Response::read().
This requires that this original buffer is large enough to contain the entire body.
Auto Trait Implementations§
impl<'resp, 'buf, C> Freeze for ResponseBody<'resp, 'buf, C>
impl<'resp, 'buf, C> RefUnwindSafe for ResponseBody<'resp, 'buf, C>where
C: RefUnwindSafe,
impl<'resp, 'buf, C> Send for ResponseBody<'resp, 'buf, C>where
C: Send,
impl<'resp, 'buf, C> Sync for ResponseBody<'resp, 'buf, C>where
C: Sync,
impl<'resp, 'buf, C> Unpin for ResponseBody<'resp, 'buf, C>
impl<'resp, 'buf, C> !UnwindSafe for ResponseBody<'resp, 'buf, 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