[][src]Enum hyper::http::h1::HttpWriter

pub enum HttpWriter<W: Write> {
    ThroughWriter(W),
    ChunkedWriter(W),
    SizedWriter(W, u64),
    EmptyWriter(W),
}

Writers to handle different Transfer-Encodings.

Variants

ThroughWriter(W)

A no-op Writer, used initially before Transfer-Encoding is determined.

ChunkedWriter(W)

A Writer for when Transfer-Encoding includes chunked.

SizedWriter(W, u64)

A Writer for when Content-Length is set.

Enforces that the body is not longer than the Content-Length header.

EmptyWriter(W)

A writer that should not write any body.

Implementations

impl<W: Write> HttpWriter<W>[src]

pub fn into_inner(self) -> W[src]

Unwraps the HttpWriter and returns the underlying Writer.

pub fn get_ref(&self) -> &W[src]

Access the inner Writer.

pub fn get_mut(&mut self) -> &mut W[src]

Access the inner Writer mutably.

Warning: You should not write to this directly, as you can corrupt the state.

pub fn end(self) -> Result<W, EndError<W>>[src]

Ends the HttpWriter, and returns the underlying Writer.

A final write_all() is called with an empty message, and then flushed. The ChunkedWriter variant will use this to write the 0-sized last-chunk.

Trait Implementations

impl<W: Write> Debug for HttpWriter<W>[src]

impl<W: Write> Write for HttpWriter<W>[src]

Auto Trait Implementations

impl<W> RefUnwindSafe for HttpWriter<W> where
    W: RefUnwindSafe

impl<W> Send for HttpWriter<W> where
    W: Send

impl<W> Sync for HttpWriter<W> where
    W: Sync

impl<W> Unpin for HttpWriter<W> where
    W: Unpin

impl<W> UnwindSafe for HttpWriter<W> where
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any
[src]

impl<W> WriteBytesExt for W where
    W: Write + ?Sized
[src]