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

Function bulkstr_parser

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

Source from the content-addressed store, hash-verified

57}
58
59fn bulkstr_parser(input: &[u8]) -> IResult<&[u8], (IType<'_>, usize)> {
60 let mut taken = 0;
61 let (rem, (strln, sz)) = bulkstrln_parser(input)?;
62 taken += sz;
63
64 let (rem, tgt_bytes) = take(strln)(rem)?;
65
66 // get rid of the \r\n
67 let (rem, _) = tag(b"\r\n")(rem)?;
68
69 taken += strln as usize + 2;
70
71 Ok((rem, (IType::BulkString(tgt_bytes), taken)))
72}
73
74fn type_parser(input: &[u8]) -> IResult<&[u8], (IType<'_>, usize)> {
75 alt((bulkstr_parser,))(input)

Callers

nothing calls this directly

Calls 1

bulkstrln_parserFunction · 0.85

Tested by

no test coverage detected