Skip to main content

complete_set

Function complete_set 

Source
pub fn complete_set<'a>(
    buffer: &'a [u8],
    header: &SetHeader<'a>,
    value: &'a [u8],
) -> Result<(Command<'a>, usize), ParseError>
Expand description

Complete parsing a SET command after the value has been received.

This function parses any remaining options (EX, PX, NX, XX) that follow the value in the command.

§Arguments

  • buffer - Buffer containing data after the value (options + CRLF)
  • header - The SET header from ParseProgress::NeedValue
  • value - The received value data

§Returns

  • Ok((Command, consumed)) - Fully parsed command
  • Err(ParseError::Incomplete) - Need more data for options
  • Err(ParseError) - Parse error