MCPcopy Create free account
hub / github.com/Firstyear/opensuse-proxy-cache / array1_parser

Function array1_parser

redis-server/src/parser.rs:215–233  ·  view source on GitHub ↗
(input: &[u8])

Source from the content-addressed store, hash-verified

213}
214
215fn array1_parser(input: &[u8]) -> IResult<&[u8], (Cmd<'_>, usize)> {
216 let mut taken = 0;
217
218 let (rem, (ln, sz)) = line_parser(input)?;
219
220 taken += sz;
221
222 tag("*1")(ln)?;
223
224 // What is the next value? That tells us if we should proceed now or not.
225 let (rem, (itype1, sz)) = type_parser(rem)?;
226 taken += sz;
227
228 match itype1 {
229 IType::BulkString(b"INFO") => Ok((rem, (Cmd::Info, taken))),
230 IType::BulkString(b"PING") => Ok((rem, (Cmd::Ping, taken))),
231 _ => Ok((rem, (Cmd::Disconnect, taken))),
232 }
233}
234
235// For the set command we can just return the size and start of bytes?
236

Callers

nothing calls this directly

Calls 2

line_parserFunction · 0.85
type_parserFunction · 0.85

Tested by

no test coverage detected