Enum redis::Value [−][src]
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]
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.
pub fn looks_like_cursor(&self) -> bool
[src]
pub 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 PartialEq for Value
[src]
impl PartialEq for Value
fn eq(&self, other: &Value) -> bool
[src]
fn eq(&self, other: &Value) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Value) -> bool
[src]
fn ne(&self, other: &Value) -> bool
This method tests for !=
.
impl Eq for Value
[src]
impl Eq for Value
impl Clone for Value
[src]
impl Clone for Value
fn clone(&self) -> Value
[src]
fn clone(&self) -> Value
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Value
[src]
impl Debug for Value
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl FromRedisValue for Value
[src]
impl FromRedisValue for Value
fn from_redis_value(v: &Value) -> RedisResult<Value>
[src]
fn from_redis_value(v: &Value) -> RedisResult<Value>
Given a redis Value
this attempts to convert it into the given destination type. If that fails because it's not compatible an appropriate error is generated. Read more
fn from_redis_values(items: &[Value]) -> RedisResult<Vec<Self>>
[src]
fn from_redis_values(items: &[Value]) -> RedisResult<Vec<Self>>
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