Trait attohttpc::body::Body

source ·
pub trait Body {
    fn kind(&mut self) -> IoResult<BodyKind>;
    fn write<W: Write>(&mut self, writer: W) -> IoResult<()>;

    fn content_type(&mut self) -> IoResult<Option<String>> { ... }
}
Expand description

A generic rewindable request body

Required Methods§

source

fn kind(&mut self) -> IoResult<BodyKind>

Determine the kind of the request body

source

fn write<W: Write>(&mut self, writer: W) -> IoResult<()>

Write out the request body into the given writer

This method can be called multiple times if a request is redirected.

Provided Methods§

source

fn content_type(&mut self) -> IoResult<Option<String>>

Gets the content type this body is tied to if it has one.

Implementors§

source§

impl Body for Multipart<'_>

source§

impl Body for Empty

source§

impl Body for File

source§

impl<B: AsRef<str>> Body for Text<B>

source§

impl<B: AsRef<[u8]>> Body for Bytes<B>

source§

impl<B: Serialize> Body for Json<B>