Trait bytecodec::io::IoEncodeExt [−][src]
pub trait IoEncodeExt: Encode { fn encode_to_write_buf<B>(&mut self, buf: &mut WriteBuf<B>) -> Result<()>
where
B: AsMut<[u8]>, { ... } fn encode_to_write_buf_async<B>(
&mut self,
buf: &mut WriteBuf<B>,
cx: &mut Context<'_>
) -> Result<()>
where
B: AsMut<[u8]>, { ... } fn encode_all<W: Write>(&mut self, writer: W) -> Result<()> { ... } }
Expand description
An extension of Encode
trait to aid encodings involving I/O.
Provided methods
Encodes the items remaining in the encoder and writes the encoded bytes to the given write buffer.
Encodes the items remaining in the encoder and
writes the encoded bytes to the given write buffer.
If the write buffer is full and the writing cannot be performed,
the given WriteBuf will memorize cx’s Waker
.
This Waker
’s wake
will later be called when the WriteBuf
regains its free space.
fn encode_all<W: Write>(&mut self, writer: W) -> Result<()>
fn encode_all<W: Write>(&mut self, writer: W) -> Result<()>
Encodes all of the items remaining in the encoder and writes the encoded bytes to the given writer.
Note that this is a blocking method.