pub async fn read_to_end(&mut self) -> Result<Bytes, Error> {
        let mut body = BytesMut::with_capacity(10_240);

        let mut me = self;
        let res: Result<(), Error> = future::poll_fn(|cx| {
            while let Some(d) = ready!(Pin::new(&mut me).poll_data(cx)) {
                body.extend(d?.bytes());
            }
            Poll::Ready(Ok(()))
        })
        .await;
        res?;

        Ok(body.freeze())
    }
/// Convenience method to read the entire body in one call
Convenience method to read the entire body in one call
Convenience method to read the entire body in one call
pub async fn read_to_end(&mut self) -> Result<Bytes, Error> {
        let mut body = BytesMut::with_capacity(10_240);
        let mut me = self;
        let res: Result<(), Error> = future::poll_fn(|cx| {
            while let Some(d) = ready!(Pin::new(&mut me).poll_data(cx)) {
                body.extend(d?.bytes());
            }
            Poll::Ready(Ok(()))
        })
        .await;
        res?;
        Ok(body.freeze())
    }
pub async fn read_to_end ( & mut self ) -> Result < Bytes , Error > { let mut body = BytesMut :: with_capacity ( 10_240 ) ; let mut me = self ; let res : Result < ( ) , Error > = future :: poll_fn ( | cx | { while let Some ( d ) = ready ! ( Pin new ( mut me ) poll_data ( cx ) ) { body . extend ( d ? . bytes ( ) ) ; } Poll :: Ready ( Ok ( ( ) ) ) } ) . await ; res ? ; Ok ( body . freeze ( ) ) }
Convenience method to read the entire body in one call
Convenience method to read the entire body in one call
&mut self