Enum hyper::client::Body [-] [+] [src]

pub enum Body<'a> {
    ChunkedBody(&'a mut Read + 'a),
    SizedBody(&'a mut Read + 'a, u64),
    BufBody(&'a [u8], usize),
}

The target enum for the IntoBody trait.

Variants

ChunkedBody

A Reader does not necessarily know it's size, so it is chunked.

SizedBody

For Readers that can know their size, like a File.

BufBody

A String has a size, and uses Content-Length.

Trait Implementations

impl<'a> Read for Body<'a>

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<(), Error>

fn read_to_string(&mut self, buf: &mut String) -> Result<(), Error>

impl<'a> IntoBody<'a> for Body<'a>

fn into_body(self) -> Body<'a>