Enum redif::Value
[−]
[src]
pub enum Value { Nil, NullArray, Int(i64), Data(Vec<u8>), Bulk(Vec<Value>), Status(String), Error(String), }
Represents a RESP value, see Redis Protocol specification.
Variants
Nil
A nil response, $-1\r\n
NullArray
Null array response, *-1\r\n
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. With the first byte of the response is ":".
Data(Vec<u8>)
An arbitary binary data. With the first byte of the response is "$".
Bulk(Vec<Value>)
A bulk response of more data. This is generally used by redis to express nested structures. With the first byte of the response is "*".
Status(String)
A status response with the first byte of the response is "+".
Error(String)
An error response with the first byte of the response is "-".
Methods
impl Value
[src]
fn decode(bytes: &[u8], start_index: usize) -> Result<(Value, usize)>
[src]
fn encode(&self) -> Vec<u8>
[src]
fn to_string(&self) -> Result<Option<String>, Utf8Error>
[src]
fn as_slice(&self) -> &[u8]
[src]
Trait Implementations
impl PartialEq for Value
[src]
fn eq(&self, __arg_0: &Value) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Value) -> bool
[src]
This method tests for !=
.
impl Eq for Value
[src]
impl Clone for Value
[src]
fn clone(&self) -> Value
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more