pub(super) async fn send_body<B>(
    mut body: B,
    io: &IoBoxed,
    codec: &h1::ClientCodec,
) -> Result<(), SendRequestError>
where
    B: MessageBody,
{
    loop {
        match poll_fn(|cx| body.poll_next_chunk(cx)).await {
            Some(result) => {
                io.encode(h1::Message::Chunk(Some(result?)), codec)?;
                io.flush(false).await?;
            }
            None => {
                io.encode(h1::Message::Chunk(None), codec)?;
                break;
            }
        }
    }
    io.flush(true).await?;

    Ok(())
}
/// send request body to the peer
send request body to the peer
send request body to the peer
pub(super) async fn send_body<B>(
    mut body: B,
    io: &IoBoxed,
    codec: &h1::ClientCodec,
) -> Result<(), SendRequestError>
where
    B: MessageBody,
{
    loop {
        match poll_fn(|cx| body.poll_next_chunk(cx)).await {
            Some(result) => {
                io.encode(h1::Message::Chunk(Some(result?)), codec)?;
                io.flush(false).await?;
            }
            None => {
                io.encode(h1::Message::Chunk(None), codec)?;
                break;
            }
        }
    }
    io.flush(true).await?;
    Ok(())
}
pub ( super ) async fn send_body < B > ( mut body : B , io : & IoBoxed , codec : & h1 :: ClientCodec , ) -> Result < ( ) , SendRequestError > where B : MessageBody , { loop { match poll_fn ( | cx | body . poll_next_chunk ( cx ) ) . await { Some ( result ) => { io . encode ( h1 :: Message :: Chunk ( Some ( result ? ) ) , codec ) ? ; io . flush ( false ) . await ? ; } None => { io . encode ( h1 :: Message :: Chunk ( None ) , codec ) ? ; break ; } } } io . flush ( true ) . await ? ; Ok ( ( ) ) }
send request body to the peer
send request body to the peer
body
B
io
&IoBoxed
codec
&h1::ClientCodec
body
B
io
&IoBoxed
codec
&h1::ClientCodec