#[non_exhaustive]pub enum ChunkStep {
Data {
skip: usize,
len: usize,
},
NeedMore {
consumed: usize,
},
Trailers {
skip: usize,
len: usize,
},
Done {
consumed: usize,
},
}Expand description
One step of ChunkedDecoder::decode, with explicit byte accounting so
a caller can decode in place in its own buffer. Offsets are relative to
the input of that call.
§Examples
See ChunkedDecoder.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Data
Skip skip framing bytes, then len bytes are body data; consume
both (skip + len) and call again with what follows.
NeedMore
More input is needed: drop the first consumed bytes (framing that
was read), keep the rest, append more, and call again.
Trailers
Skip skip framing bytes, then len bytes are the trailer section
(its field lines and the blank line), already validated; consume
both, and the next call reports ChunkStep::Done. Only reported for
a section that has at least one field.
Fields
Done
The body is complete after consumed more bytes (the last chunk and
an empty trailer section); what follows belongs to the next message.