Skip to main content

Module parser

Module parser 

Source
Expand description

Memcached text-protocol parser.

The parser is a single byte-driven state machine for requests and another for responses, faithfully reproducing the state set and transitions of memcache_parse_req and memcache_parse_rsp in the reference engine. It mutates a Msg in place: the command tag, key list, value-length accumulator, and parser cursor are written back so the streaming caller can resume the machine on more bytes without re-allocating state.

The parsers MUST NOT panic on any input. Invalid bytes are reported via MsgParseResult::Error.

Structs§

HashTag
Optional hash tag delimiters. When set, parsed keys carry the inner range between the delimiters as the routing tag.

Enums§

ReqState
State alphabet for memcache_parse_req.
RspState
State alphabet for memcache_parse_rsp.

Constants§

MEMCACHE_MAX_KEY_LENGTH
Maximum allowed Memcached key length in bytes.

Functions§

memcache_parse_req
Parse a Memcached request from input and update r in place.
memcache_parse_req_tagged
Variant of memcache_parse_req that accepts an explicit hash-tag configuration.
memcache_parse_rsp
Parse a Memcached response from input and update r in place.