serde-RESP
Redis RESP protocol serialization and deserialization with serde. Read Specification
[dependencies]
serde-resp = "0.1.0"
Usage
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.
SimpleStringRESPType::SimpleString(String)
ErrorRESPType::Error(String)
IntegerRESPType::Integer(i64)
BulkStringRESPType::BulkString(Option<Vec<u8>>)- Use
Nonefor null bulk strings andSomefor non-null ones.
- Use
ArrayRESPType::Array(Option<Vec<RESPType>>)- Use
Nonefor null arrays andSomefor non-null ones.
- Use
To serialize, use ser::to_string or ser::to_writer.
To deserialize, use ser::from_buf_reader.
For usage examples, refer to https://docs.rs/serde_resp/0.1.0/serde_resp/enum.RESPType.html