Skip to main content

Module io

Module io 

Source
Expand description

Adapter from message-framed Transports to byte-stream Read/Write callers.

Length-prefix protocols (the coordinator’s message framing) are written against Read + Write streams. The registry transports are message-framed: one send is one recv payload. TransportIo bridges the two worlds:

  • write buffers; flush emits exactly one transport message (so write_all(prefix); write_all(body); flush() becomes a single frame, preserving the caller’s framing).
  • read serves from an internal buffer refilled one transport message at a time; a clean close yields Ok(0) (EOF).

Structs§

TransportIo