Module codec

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§

AnyDelimiterCodec
A simple Decoder and Encoder implementation that splits up data into chunks based on any character in the given delimiter string.
BytesCodec
A simple Decoder and Encoder implementation that just ships bytes around.
Framed
A unified Stream and Sink interface to an underlying I/O object, using the Encoder and Decoder traits to encode and decode frames.
FramedParts
FramedParts contains an export of the data of a Framed transport. It can be used to construct a new Framed with a different codec. It contains all current buffers and the inner transport.
FramedRead
A Stream of messages decoded from an AsyncRead.
FramedWrite
A Sink of frames encoded to an AsyncWrite.
LengthDelimitedCodec
A codec for frames delimited by a frame head specifying their lengths.
LengthDelimitedCodecError
An error when the number of bytes read is more than max frame length.
LinesCodec
A simple Decoder and Encoder implementation that splits up data into lines.

Enums§

AnyDelimiterCodecError
An error occurred while encoding or decoding a chunk.
LinesCodecError
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.