Struct tk_http::server::RawBody
[−]
[src]
pub struct RawBody<S> { /* fields omitted */ }
The actual raw body
The object is used to write some data directly to the socket without any buffering/copying. Note that chunked encoding must be handled manually in this case.
This is a tiny wrapper around WriteRaw
which is basically tiny wrapper
around TcpStream or whatever S
represents. Wrappers are used to
reconstruct original object, EncoderDone
in this case.
Methods
impl<S> RawBody<S>
[src]
fn done(self) -> EncoderDone<S>
Returns EncoderDone
object that might be passed back to the HTTP
protocol
Trait Implementations
impl<T: Destination> Destination for RawBody<T>
[src]
fn write_file<O: FileOpener>(
&mut self,
file: &mut Sendfile<O>
) -> Result<usize, Error>
&mut self,
file: &mut Sendfile<O>
) -> Result<usize, Error>
This method does the actual sendfile call Read more
fn poll_write(&self) -> Async<()>
Test whether this socket is ready to be written to or not. Read more
impl<S: AsyncWrite> Write for RawBody<S>
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this object, returning how many bytes were written. Read more
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
Attempts to write an entire buffer into this write. Read more
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0
Writes a formatted string into this writer, returning any error encountered. Read more
fn by_ref(&mut self) -> &mut Self
1.0.0
Creates a "by reference" adaptor for this instance of Write
. Read more
impl<S: AsyncWrite> AsyncWrite for RawBody<S>
[src]
fn shutdown(&mut self) -> Poll<(), Error>
Initiates or attempts to shut down this writer, returning success when the I/O connection has completely shut down. Read more
fn write_buf<B>(&mut self, buf: &mut B) -> Result<Async<usize>, Error> where
B: Buf,
B: Buf,
Write a Buf
into this value, returning how many bytes were written. Read more