| Crates.io | resp |
| lib.rs | resp |
| version | 1.0.3 |
| created_at | 2016-02-12 13:21:25.631911+00 |
| updated_at | 2022-08-19 14:01:58.045684+00 |
| description | RESP(REdis Serialization Protocol) Serialization for Rust. |
| homepage | https://github.com/iorust/resp |
| repository | https://github.com/iorust/resp.git |
| max_upload_size | |
| id | 4156 |
| size | 62,596 |
RESP(REdis Serialization Protocol) Serialization for Rust.
Implementations:
extern crate resp;
use resp::{Value, encode, encode_slice, Decoder};
enum Value {
/// Null bulk reply, $-1\r\n
Null,
/// Null array reply, *-1\r\n
NullArray,
/// For Simple Strings the first byte of the reply is "+"
String(String),
/// For Errors the first byte of the reply is "-"
Error(String),
/// For Integers the first byte of the reply is ":"
Integer(i64),
/// For Bulk Strings the first byte of the reply is "$"
Bulk(String),
/// For Bulk <binary> Strings the first byte of the reply is "$"
BufBulk(Vec<u8>),
/// For Arrays the first byte of the reply is "*"
Array(Vec<Value>),
}
value.is_null() -> boolvalue.is_error() -> boolvalue.encode() -> Vec<u8>value.to_encoded_string() -> io::Result<String>value.to_beautify_string() -> Stringfn encode(value: &Value) -> Vec<u8>fn encode_slice(array: &[&str]) -> Vec<u8>Decoder.new(reader: BufReader<R>) -> SelfDecoder.with_buf_bulk(reader: BufReader<R>) -> Selfdecoder.decode() -> Result<Value>