Trait async_codec::AsyncEncode
[−]
[src]
pub trait AsyncEncode where
Self: Sized, { fn poll_encode<W: AsyncWrite>(
self,
cx: &mut Context,
writer: &mut W
) -> PollEnc<Self>; }
A trait for types that asynchronously encode into an AsyncWrite
.
Required Methods
fn poll_encode<W: AsyncWrite>(
self,
cx: &mut Context,
writer: &mut W
) -> PollEnc<Self>
self,
cx: &mut Context,
writer: &mut W
) -> PollEnc<Self>
Call writer.poll_write
once with encoded data, propagating any Err
and
Pending
, and returning how many bytes were written.
This consumes ownership of the encoder. If encoding did not terminate, the return value contains a new encoder that will resume at the correct point.
If writer.poll_write
returns Ok(Ready(0))
even though the value has not been fully
encoded, this must return an error of kind WriteZero
.