Enum redis_cli::Value []

pub enum Value {
    Null,
    NullArray,
    String(String),
    Error(String),
    Integer(i64),
    Bulk(String),
    BufBulk(Vec<u8>),
    Array(Vec<Value>),
}

Represents a RESP value http://redis.io/topics/protocol

Variants

Null

Null bulk reply, $-1\r\n

NullArray

Null array reply, *-1\r\n

String(String)

For Simple Strings the first byte of the reply is "+"[43]

Error(String)

For Errors the first byte of the reply is "-"[45]

Integer(i64)

For Integers the first byte of the reply is ":"[58]

Bulk(String)

For Bulk Strings the first byte of the reply is "$"[36]

BufBulk(Vec<u8>)

For Bulk Strings the first byte of the reply is "$"[36]

Array(Vec<Value>)

For Arrays the first byte of the reply is "*"[42]

Methods

impl Value

fn is_null(&self) -> bool

Returns true if the Value is a Null. Returns false otherwise.

fn is_error(&self) -> bool

Returns true if the Value is a Error. Returns false otherwise.

fn encode(&self) -> Vec<u8>

fn to_encoded_string(&self) -> Result<StringError>

fn to_beautify_string(&self) -> String

Trait Implementations

impl Debug for Value

fn fmt(&self, __arg_0: &mut Formatter) -> Result<()Error>

impl PartialEq<Value> for Value

fn eq(&self, __arg_0: &Value) -> bool

fn ne(&self, __arg_0: &Value) -> bool

impl Eq for Value

impl Clone for Value

fn clone(&self) -> Value