aembke / redis-protocol.rs

A Rust implementation of RESP2 and RESP3
Apache License 2.0
41 stars 14 forks source link

4.0.1 #19

Closed aembke closed 2 years ago

aembke commented 2 years ago
aembke commented 2 years ago

cc @rukai if you want to take a look.

The primary decoder interface for both RESP2 and RESP3 uses Bytes, as do all of the Frame types. The complicated parsing needed for BytesMut is behind the decode-mut feature flag. I didn't want to make the &mut BytesMut decoder generic since I plan on optimizing that a bit more in the future, and that will likely be pretty invasive.

One other notable change - the SimpleString variants for both RESP2 and RESP3 now do not do any UTF-8 string parsing to support callers that use this with the MONITOR interface (since that interface can embed non-UTF8 byte slices inside a SimpleString frame). You also might want to keep this in mind in shotover-proxy in case you have any str::from_utf8 calls hidden in there.