resp

Crates.ioresp
lib.rsresp
version1.0.3
sourcesrc
created_at2016-02-12 13:21:25.631911
updated_at2022-08-19 14:01:58.045684
descriptionRESP(REdis Serialization Protocol) Serialization for Rust.
homepagehttps://github.com/iorust/resp
repositoryhttps://github.com/iorust/resp.git
max_upload_size
id4156
size62,596
0xZensh (zensh)

documentation

https://docs.rs/resp

README

RESP

RESP(REdis Serialization Protocol) Serialization for Rust.

Crates version Build Status Coverage Status Crates downloads Docs Status

Implementations:

API

extern crate resp;
use resp::{Value, encode, encode_slice, Decoder};

RESP Values

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() -> bool

value.is_error() -> bool

value.encode() -> Vec<u8>

value.to_encoded_string() -> io::Result<String>

value.to_beautify_string() -> String

encode

fn encode(value: &Value) -> Vec<u8>

fn encode_slice(array: &[&str]) -> Vec<u8>

Decoder

Decoder.new(reader: BufReader<R>) -> Self

Decoder.with_buf_bulk(reader: BufReader<R>) -> Self

decoder.decode() -> Result<Value>

Commit count: 39

cargo fmt