[][src]Enum redis::Value

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

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(Vec<u8>)

An arbitary binary data.

Bulk(Vec<Value>)

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

Status(String)

A status response.

Okay

A status response which represents the string "OK".

Methods

impl Value[src]

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.

pub fn looks_like_cursor(&self) -> bool[src]

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 FromRedisValue for Value[src]

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

Similar to from_redis_value but constructs a vector of objects from another vector of values. This primarily exists internally to customize the behavior for vectors of tuples. Read more

impl Clone for Value[src]

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

Performs copy-assignment from source. Read more

impl Eq for Value[src]

impl PartialEq<Value> for Value[src]

impl Debug for Value[src]

Auto Trait Implementations

impl Send for Value

impl Sync for Value

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Erased for T