Enum hyper::http::h1::HttpWriter [−][src]
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.
Methods
impl<W: Write> HttpWriter<W>
[src]
impl<W: Write> HttpWriter<W>
pub fn into_inner(self) -> W
[src]
pub fn into_inner(self) -> W
Unwraps the HttpWriter and returns the underlying Writer.
ⓘImportant traits for &'a mut Rpub fn get_ref(&self) -> &W
[src]
pub fn get_ref(&self) -> &W
Access the inner Writer.
ⓘImportant traits for &'a mut Rpub fn get_mut(&mut self) -> &mut W
[src]
pub fn get_mut(&mut self) -> &mut W
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]
pub fn end(self) -> Result<W, EndError<W>>
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> Write for HttpWriter<W>
[src]
impl<W: Write> Write for HttpWriter<W>
fn write(&mut self, msg: &[u8]) -> Result<usize>
[src]
fn write(&mut self, msg: &[u8]) -> Result<usize>
Write a buffer into this object, returning how many bytes were written. Read more
fn flush(&mut self) -> Result<()>
[src]
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this write. Read more
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
Writes a formatted string into this writer, returning any error encountered. Read more
ⓘImportant traits for &'a mut Rfn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
Creates a "by reference" adaptor for this instance of Write
. Read more
impl<W: Write> Debug for HttpWriter<W>
[src]
impl<W: Write> Debug for HttpWriter<W>
Auto Trait Implementations
impl<W> Send for HttpWriter<W> where
W: Send,
impl<W> Send for HttpWriter<W> where
W: Send,
impl<W> Sync for HttpWriter<W> where
W: Sync,
impl<W> Sync for HttpWriter<W> where
W: Sync,