Skip to main content

Module stream

Module stream 

Source
Expand description

Stream decoders for the two Codec wire formats.

Adapt any std::io::Read (sync) or tokio::io::AsyncRead (async, behind the tokio feature) into an iterator/stream of CodecFrames.

Structs§

MsgpackFrameIter
Iterator over MessagePack frames pulled from R.
ProtobufFrameIter
Iterator over length-prefixed protobuf frames pulled from R.

Enums§

StreamError
Errors raised by the stream decoders.

Functions§

decode_msgpack_stream
Yield frames from a stream of concatenated MessagePack maps.
decode_protobuf_frame
Decode a single CodecFrame protobuf payload (no length prefix).
decode_protobuf_stream
Yield frames from a stream of length-prefixed protobuf CodecFrame payloads. Wire: 4-byte big-endian length followed by the protobuf bytes.
encode_msgpack_frame
Encode frame as a single MessagePack map. Used by tests and any caller that wants to round-trip via the wire format.
encode_protobuf_frame
Encode frame as a length-prefixed protobuf frame (4-byte BE length + payload).