Skip to main content

into_client_body

Function into_client_body 

Source
pub fn into_client_body<B>(body: B) -> ClientBody
where B: Body + Send + Sync + 'static, B::Data: Buf + Send, B::Error: Into<Box<dyn Error + Send + Sync>>,
Expand description

Converts an arbitrary body into the type-erased ClientBody.

This uses Buf::copy_to_bytes for the data conversion, which is zero-copy when the underlying data is already Bytes.