pub fn parse_streaming<'a>(
buffer: &'a [u8],
options: &ParseOptions,
streaming_threshold: usize,
) -> Result<ParseProgress<'a>, ParseError>Expand description
Parse a command, potentially yielding early for large SET values.
This function provides the streaming parse capability. For SET commands
with values >= STREAMING_THRESHOLD, it returns NeedValue after parsing
the header, allowing the caller to receive the value directly into a
target buffer.
For all other commands (including small SETs), it behaves identically to
Command::parse().
§Arguments
buffer- The input buffer containing RESP dataoptions- Parse options (max lengths, etc.)streaming_threshold- Minimum value size for streaming (useSTREAMING_THRESHOLD)
§Returns
Ok(ParseProgress::Incomplete)- Need more dataOk(ParseProgress::NeedValue { .. })- SET header parsed, value pendingOk(ParseProgress::Complete(cmd, consumed))- Fully parsed commandErr(ParseError)- Parse error