pub enum ShardResponse {
Show 23 variants
Value(Option<Value>),
Ok,
Integer(i64),
Bool(bool),
Ttl(TtlResult),
OutOfMemory,
KeyCount(usize),
Stats(KeyspaceStats),
Len(usize),
Array(Vec<Bytes>),
TypeName(&'static str),
ZAddLen {
count: usize,
applied: Vec<(f64, String)>,
},
ZRemLen {
count: usize,
removed: Vec<String>,
},
Score(Option<f64>),
Rank(Option<usize>),
ScoredArray(Vec<(String, f64)>),
WrongType,
Err(String),
Scan {
cursor: u64,
keys: Vec<String>,
},
HashFields(Vec<(String, Bytes)>),
HDelLen {
count: usize,
removed: Vec<String>,
},
StringArray(Vec<String>),
OptionalArray(Vec<Option<Bytes>>),
}Expand description
The shard’s response to a request.
Variants§
Value(Option<Value>)
A value (or None for a cache miss).
Ok
Simple acknowledgement (e.g. SET).
Integer(i64)
Integer result (e.g. INCR, DECR).
Bool(bool)
Boolean result (e.g. DEL, EXISTS, EXPIRE).
Ttl(TtlResult)
TTL query result.
OutOfMemory
Memory limit reached and eviction policy is NoEviction.
KeyCount(usize)
Key count for a shard (DBSIZE).
Stats(KeyspaceStats)
Full stats for a shard (INFO).
Len(usize)
Integer length result (e.g. LPUSH, RPUSH, LLEN).
Array(Vec<Bytes>)
Array of bulk values (e.g. LRANGE).
TypeName(&'static str)
The type name of a stored value.
ZAddLen
ZADD result: count for the client + actually applied members for AOF.
ZRemLen
ZREM result: count for the client + actually removed members for AOF.
Score(Option<f64>)
Float score result (e.g. ZSCORE).
Rank(Option<usize>)
Rank result (e.g. ZRANK).
ScoredArray(Vec<(String, f64)>)
Scored array of (member, score) pairs (e.g. ZRANGE).
WrongType
Command used against a key holding the wrong kind of value.
Err(String)
An error message.
Scan
Scan result: next cursor and list of keys.
HashFields(Vec<(String, Bytes)>)
HGETALL result: all field-value pairs.
HDelLen
HDEL result: removed count + field names for AOF.
StringArray(Vec<String>)
Array of strings (e.g. HKEYS).
OptionalArray(Vec<Option<Bytes>>)
HMGET result: array of optional values.