Enum redis::Value [] [src]

pub enum Value {
    Nil,
    Int(i64),
    Data(Vec<u8>),
    Bulk(Vec<Value>),
    Status(String),
    Okay,
}

Internal low-level redis value enum.

Variants

Nil

A nil response from the server.

Int

An integer response. Note that there are a few situations in which redis actually returns a string for an integer which is why this library generally treats integers and strings the same for all numeric responses.

Data

An arbitary binary data.

Bulk

A bulk response of more data. This is generally used by redis to express nested structures.

Status

A status response.

Okay

A status response which represents the string "OK".

Methods

impl Value

Values are generally not used directly unless you are using the more low level functionality in the library. For the most part this is hidden with the help of the FromRedisValue trait.

While on the redis protocol there is an error type this is already separated at an early point so the value only holds the remaining types.

fn looks_like_cursor(&self) -> bool

Checks if the return value looks like it fulfils the cursor protocol. That means the result is a bulk item of length two with the first one being a cursor and the second a bulk response.

Trait Implementations

impl Debug for Value

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

impl FromRedisValue for Value

fn from_redis_value(v: &Value) -> RedisResult<Value>

fn from_redis_values(items: &[Value]) -> RedisResult<Vec<Self>>

Derived Implementations

impl Clone for Value

fn clone(&self) -> Value

1.0.0fn clone_from(&mut self, source: &Self)

impl Eq for Value

impl PartialEq for Value

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

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