tubes.framing
module documentationtubes
Tubes that can convert streams of data into discrete chunks and back again.
Function | bytesToNetstrings | Create a new tube for converting a stream of byte segments containing DJB-style netstrings into bytes. |
Function | netstringsToBytes | Create a new tube for encoding a sequence of discrete frames of bytes into DJB-style netstrings on the wire. |
Function | linesToBytes | Convert lines into bytes. |
Function | bytesDelimitedBy | Consumes a stream of bytes and produces frames delimited by the given delimiter. |
Function | bytesToLines | Create a drain that consumes a stream of bytes and produces frames delimited by LF or CRLF. |
Function | bytesToIntPrefixed | Convert a sequence of byte segments with packed network-endian int prefixes of the given bit width into frames of the indicated sizes. |
Function | intPrefixedToBytes | Prepend packed network endian lengths to a sequence of bytes representing frames. |
Class | _Transporter | Just enough of a mock of ITransport
to work with the protocols in basic ,
as a wrapper around a callable taking some data. |
Class | _FramesToSegments | A tube which could convert "frames " - discrete
chunks of data - into "segments " - parts of
a raw data stream, with framing headers or delimiters attached. |
Class | _NotDisconnecting | Enough of a transport to pretend to not be disconnecting. |
Class | _SegmentsToFrames | Convert segments into frames by parsing them. |
Class | _CarriageReturnRemover | Automatically fix newlines, because hacker news. |
Convert lines into bytes.
Returns | Create a new tube for adding CRLF delimiters to a sequence of lines (frames) to produce bytes (segments). |
Create a drain that consumes a stream of bytes and produces frames delimited by LF or CRLF.
Returns | a new IDrain that does
the given conversion. |
Convert a sequence of byte segments with packed network-endian int prefixes of the given bit width into frames of the indicated sizes.
Parameters | prefixBits | The number of bits to use for the length prefix: either 8, 16, or 32. |
Returns | a new ITube that does the
conversion. |
Prepend packed network endian lengths to a sequence of bytes representing frames.
Parameters | prefixBits | The number of bits to use for the length prefix: either 8, 16, or 32. |
Returns | a new ITube that does the
conversion. |