Trait WriteBody

Source
pub trait WriteBody<W> {
    // Required methods
    fn write_body(&mut self, w: &mut W) -> Result<(), Error>;
    fn reset(&mut self) -> bool;
}
Expand description

A trait implemented by streaming bodies.

Required Methods§

Source

fn write_body(&mut self, w: &mut W) -> Result<(), Error>

Writes the body out, in its entirety.

Behavior is unspecified if this method is called twice without a successful call to reset in between.

Source

fn reset(&mut self) -> bool

Attempts to reset the body so that it can be written out again.

Returns true if successful. Behavior is unspecified if this is not called after a call to write_body.

Implementations on Foreign Types§

Source§

impl<W> WriteBody<W> for &[u8]
where W: Write,

Source§

fn write_body(&mut self, w: &mut W) -> Result<(), Error>

Source§

fn reset(&mut self) -> bool

Implementors§