Redis RESP protocol serialization and deserialization with serde. Read Specification
[dependencies]
serde-resp = "0.1.0"
IMPORTANT: Do NOT serialize and deserialize with any other types besides RESPType
! You may get panic or incorrect results!
Here are the RESP types and their corresponding Rust types for serde.
SimpleString
RESPType::SimpleString(String)
Error
RESPType::Error(String)
Integer
RESPType::Integer(i64)
BulkString
RESPType::BulkString(Option<Vec<u8>>)
None
for null bulk strings and Some
for non-null ones.Array
RESPType::Array(Option<Vec<RESPType>>)
None
for null arrays and Some
for non-null ones.To serialize, use ser::tostring or ser::towriter.
To deserialize, use ser::frombufreader.
For usage examples, refer to https://docs.rs/serderesp/0.1.0/serderesp/enum.RESPType.html
https://docs.rs/serderesp/0.1.0/serderesp