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

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

Writers to handle different Transfer-Encodings.



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


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.


A writer that should not write any body.


impl<W> HttpWriter<W> where
    W: Write

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> Debug for HttpWriter<W> where
    W: Write

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

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

impl<T, I> AsResult<T, I> for T where
    I: Input, 

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> IntoCollection<T> for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

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