pub trait HttpBody {
type Err;
type Data: Into<Vec<u8>>;
// Required method
fn read_next(&mut self) -> Result<Option<Self::Data>, Self::Err>;
// Provided methods
fn size_hint(&self) -> Option<usize> { ... }
fn read_all_bytes(&mut self) -> Result<Vec<u8>, Self::Err> { ... }
}
Expand description
Represents an object that can be used to read the request or response body data.