Expand description
Byte-delimited framing.
Frames are separated by a configured delimiter byte sequence (typically
\n for newline-terminated text, or \r\n for HTTP-style protocols). The
delimiter is stripped from the emitted payload but counted toward
Frame::consumed.
§Limits and streaming
Delimited::new keeps the 1.0 behaviour of an unbounded payload size,
which lets a peer that never sends the delimiter grow the caller’s buffer
without limit. For untrusted input, use Delimited::bounded (a
Delimited::DEFAULT_MAX_PAYLOAD cap) or Delimited::with_max_payload.
When input arrives in pieces, call Framer::next_frame_from or use a
StreamDecoder so the search resumes
where it stopped instead of rescanning the buffered prefix on every call.
Structs§
- Delimited
- Byte-delimited framer.