Available on
target_family="unix" only.Expand description
Adaptors from AsyncRead/AsyncWrite to Stream/Sink
Raw I/O objects work with byte sequences, but higher-level code usually wants to batch these into meaningful chunks, called “frames”.
Re-export of tokio_util::codec.
Modules§
- length_
delimited - Frame a stream of bytes based on a length prefix
Structs§
- AnyDelimiter
Codec - A simple
DecoderandEncoderimplementation that splits up data into chunks based on any character in the given delimiter string. - Bytes
Codec - A simple
DecoderandEncoderimplementation that just ships bytes around. - Framed
- A unified
StreamandSinkinterface to an underlying I/O object, using theEncoderandDecodertraits to encode and decode frames. - Framed
Parts FramedPartscontains an export of the data of a Framed transport. It can be used to construct a newFramedwith a different codec. It contains all current buffers and the inner transport.- Framed
Read - A
Streamof messages decoded from anAsyncRead. - Framed
Write - A
Sinkof frames encoded to anAsyncWrite. - Length
Delimited Codec - A codec for frames delimited by a frame head specifying their lengths.
- Length
Delimited Codec Error - An error when the number of bytes read is more than max frame length.
- Lines
Codec - A simple
DecoderandEncoderimplementation that splits up data into lines.
Enums§
- AnyDelimiter
Codec Error - An error occurred while encoding or decoding a chunk.
- Lines
Codec Error - An error occurred while encoding or decoding a line.
Traits§
- Decoder
- Decoding of frames via buffers.
- Encoder
- Trait of helper objects to write out messages as bytes, for use with
FramedWrite.