Trait async_codec::AsyncEncode
[−]
[src]
pub trait AsyncEncode<W: AsyncWrite> { fn poll_encode(
&mut self,
cx: &mut Context,
writer: &mut W
) -> Poll<usize, FutIoErr>; }
A trait for types that asynchronously encode into an AsyncWrite.
Required Methods
fn poll_encode(
&mut self,
cx: &mut Context,
writer: &mut W
) -> Poll<usize, FutIoErr>
&mut self,
cx: &mut Context,
writer: &mut W
) -> Poll<usize, FutIoErr>
Call writer.poll_write once with encoded data, propagating any Err and
Pending, and returning how many bytes were written.
After the value has been fully encoded, the next call to this must return Ok(Ready(0))
and must not call writer_poll_write.
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.