[−][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
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.
Methods
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,
W: RefUnwindSafe,
impl<W> Send for HttpWriter<W> where
W: Send,
W: Send,
impl<W> Sync for HttpWriter<W> where
W: Sync,
W: Sync,
impl<W> Unpin for HttpWriter<W> where
W: Unpin,
W: Unpin,
impl<W> UnwindSafe for HttpWriter<W> where
W: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<T> Typeable for T where
T: Any,
[src][+]
T: Any,
impl<W> WriteBytesExt for W where
W: Write + ?Sized,
[src][+]
W: Write + ?Sized,