serde-resp 0.2.0

Redis RESP protocol serialization and deserialization with serde
Documentation

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.

  • SimpleString
    • RESPType::SimpleString(String)
  • Error
    • RESPType::Error(String)
  • Integer
    • RESPType::Integer(i64)
  • BulkString
    • RESPType::BulkString(Option<Vec<u8>>)
      • Use None for null bulk strings and Some for non-null ones.
  • Array
    • RESPType::Array(Option<Vec<RESPType>>)
      • Use None for null arrays and Some for non-null ones.

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

Examples & Documentation

https://docs.rs/serde_resp/0.1.0/serde_resp