Struct async_http_codec::BodyEncode
source · pub struct BodyEncode<IO: AsyncWrite + Unpin> { /* private fields */ }
Implementations§
source§impl<IO: AsyncWrite + Unpin> BodyEncode<IO>
impl<IO: AsyncWrite + Unpin> BodyEncode<IO>
pub fn new(transport: IO, length: Option<u64>) -> Self
pub fn checkpoint(self) -> (IO, BodyEncodeState)
pub fn from_headers(headers: &HeaderMap, transport: IO) -> Result<Self>
Trait Implementations§
source§impl<IO: AsyncWrite + Unpin> AsyncWrite for BodyEncode<IO>
impl<IO: AsyncWrite + Unpin> AsyncWrite for BodyEncode<IO>
source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
Attempt to write bytes from
buf
into the object. Read moresource§fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Attempt to flush the object, ensuring that any buffered data reach
their destination. Read more
Auto Trait Implementations§
impl<IO> RefUnwindSafe for BodyEncode<IO>where
IO: RefUnwindSafe,
impl<IO> Send for BodyEncode<IO>where
IO: Send,
impl<IO> Sync for BodyEncode<IO>where
IO: Sync,
impl<IO> Unpin for BodyEncode<IO>
impl<IO> UnwindSafe for BodyEncode<IO>where
IO: UnwindSafe,
Blanket Implementations§
§impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
§fn flush(&mut self) -> Flush<'_, Self>where
Self: Unpin,
fn flush(&mut self) -> Flush<'_, Self>where
Self: Unpin,
Creates a future which will entirely flush this
AsyncWrite
. Read more§fn close(&mut self) -> Close<'_, Self>where
Self: Unpin,
fn close(&mut self) -> Close<'_, Self>where
Self: Unpin,
Creates a future which will entirely close this
AsyncWrite
.§fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self>where
Self: Unpin,
fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self>where
Self: Unpin,
Creates a future which will write bytes from
buf
into the object. Read more§fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self>where
Self: Unpin,
fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self>where
Self: Unpin,
Creates a future which will write bytes from
bufs
into the object using vectored
IO operations. Read more