pub enum Value {
Show 15 variants
SimpleString(Bytes),
SimpleError(Bytes),
Integer(i64),
BulkString(Bytes),
Array(Vec<Value>),
Null,
Boolean(bool),
Double(f64),
BigNumber(Bytes),
BulkError(Bytes),
VerbatimString {
encoding: [u8; 3],
data: Bytes,
},
Map(Vec<(Value, Value)>),
Attribute {
attrs: Vec<(Value, Value)>,
value: Box<Value>,
},
Set(Vec<Value>),
Push(Vec<Value>),
}Expand description
A parsed RESP value covering all RESP2 and RESP3 wire types.
PartialEq is derived; f64::NAN != f64::NAN per IEEE 754 is correct behaviour.
Variants§
SimpleString(Bytes)
+<str>\r\n — short non-binary status string, e.g. "OK"
SimpleError(Bytes)
-<msg>\r\n — error (raw bytes, includes the kind prefix e.g. "ERR bad")
Integer(i64)
:<n>\r\n — 64-bit signed integer
BulkString(Bytes)
$<len>\r\n<data>\r\n — binary-safe bulk string
Array(Vec<Value>)
*<count>\r\n<elements> — ordered array
Null
Boolean(bool)
#t\r\n / #f\r\n
Double(f64)
,<value>\r\n — IEEE 754 double; encodes inf, -inf, nan
BigNumber(Bytes)
(<decimal>\r\n — arbitrary-precision integer as raw decimal bytes (no bignum dep)
BulkError(Bytes)
!<len>\r\n<data>\r\n — binary-safe error payload
VerbatimString
=<len>\r\n<enc>:<data>\r\n — string with 3-byte encoding hint
Map(Vec<(Value, Value)>)
%<count>\r\n<key><value>... — key-value map
Attribute
|<count>\r\n<key><value>...<reply> — attribute metadata + actual reply
Set(Vec<Value>)
~<count>\r\n<elements> — unordered unique set
Push(Vec<Value>)
><count>\r\n<elements> — out-of-band push message