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.
def bytesToNetstrings():

Create a new tube for converting a stream of byte segments containing DJB-style netstrings into bytes.

Returnsa tube that splits a stream of segments containing nestrings into frame.
def netstringsToBytes():

Create a new tube for encoding a sequence of discrete frames of bytes into DJB-style netstrings on the wire.

Returnsa tube that puts netstring length encoding around frames to produce segments.
def linesToBytes():

Convert lines into bytes.

ReturnsCreate a new tube for adding CRLF delimiters to a sequence of lines (frames) to produce bytes (segments).
def bytesDelimitedBy(delimiter):

Consumes a stream of bytes and produces frames delimited by the given delimiter.

Parametersdelimiteran octet sequence that separates frames in the incoming stream of bytes. (type: bytes)
Returnsa tube that converts a stream of bytes into a sequence of frames. (type: ITube)
def bytesToLines():

Create a drain that consumes a stream of bytes and produces frames delimited by LF or CRLF.

Returnsa new IDrain that does the given conversion.
def bytesToIntPrefixed(prefixBits):

Convert a sequence of byte segments with packed network-endian int prefixes of the given bit width into frames of the indicated sizes.

ParametersprefixBitsThe number of bits to use for the length prefix: either 8, 16, or 32.
Returnsa new ITube that does the conversion.
def intPrefixedToBytes(prefixBits):

Prepend packed network endian lengths to a sequence of bytes representing frames.

ParametersprefixBitsThe number of bits to use for the length prefix: either 8, 16, or 32.
Returnsa new ITube that does the conversion.
API Documentation for tubes, generated by pydoctor at 2016-01-18 07:46:47.