[][src]Enum darkredis::Value

pub enum Value {
    Ok,
    Nil,
    Array(Vec<Value>),
    Integer(isize),
    String(Vec<u8>),
}

Enum depicting the various possible responses one can get from Redis.

Variants

Ok

A Redis OK response.

Nil

Nil Response.

Array(Vec<Value>)

Array response.

Integer(isize)

Integer response.

String(Vec<u8>)

String response. This cannot be a String type, because Redis strings need not be valid UTF-8, unlike Rust.

Methods

impl Value[src]

pub fn unwrap_integer(self) -> isize[src]

Returns the inner isize of a Value::Integer.

Panics

Panics if self is not a Value::Integer

pub fn unwrap_array(self) -> Vec<Value>[src]

Returns the inner Vec<Value> of a Value::Array.

Panics

Panics if self is not a Value::Array

pub fn unwrap_string(self) -> Vec<u8>[src]

Returns the inner Vec<u8> of a Value::String.

Panics

Panics if self is not a Value::String

pub fn optional_string(self) -> Option<Vec<u8>>[src]

Like unwrap_string, but returns an Option instead of panicking.

pub fn optional_array(self) -> Option<Vec<Value>>[src]

Like unwrap_array, but returns an Option instead of panicking.

pub fn optional_integer(self) -> Option<isize>[src]

Like unwrap_integer, but returns an Option instead of panicking.

Trait Implementations

impl PartialEq<Value> for Value[src]

impl Debug for Value[src]

Auto Trait Implementations

impl Sync for Value

impl Send for Value

impl Unpin for Value

impl RefUnwindSafe for Value

impl UnwindSafe for Value

Blanket Implementations

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

impl<T> Erased for T