The returned LinesCodec will not have an upper bound on the length
of a buffered line. See the documentation for new_with_max_length
for information on why this could be a potential security risk.
Returns a LinesCodec with a maximum line length limit.
If this is set, calls to LinesCodec::decode will return a
LinesCodecError when a line exceeds the length limit. Subsequent calls
will discard up to limit bytes from that line until a newline
character is reached, returning None until the line over the limit
has been fully discarded. After that point, calls to decode will
function as normal.
Setting a length limit is highly recommended for any LinesCodec which
will be exposed to untrusted input. Otherwise, the size of the buffer
that holds the line currently being read is unbounded. An attacker could
exploit this unbounded buffer by sending an unbounded amount of input
without any \n characters, causing unbounded memory consumption.