pub enum Command {
Show 69 variants
Ping(Option<Bytes>),
Echo(Bytes),
Get {
key: String,
},
Set {
key: String,
value: Bytes,
expire: Option<SetExpire>,
nx: bool,
xx: bool,
},
Incr {
key: String,
},
Decr {
key: String,
},
Del {
keys: Vec<String>,
},
Exists {
keys: Vec<String>,
},
MGet {
keys: Vec<String>,
},
MSet {
pairs: Vec<(String, Bytes)>,
},
Expire {
key: String,
seconds: u64,
},
Ttl {
key: String,
},
Persist {
key: String,
},
Pttl {
key: String,
},
Pexpire {
key: String,
milliseconds: u64,
},
DbSize,
Info {
section: Option<String>,
},
BgSave,
BgRewriteAof,
FlushDb,
Scan {
cursor: u64,
pattern: Option<String>,
count: Option<usize>,
},
LPush {
key: String,
values: Vec<Bytes>,
},
RPush {
key: String,
values: Vec<Bytes>,
},
LPop {
key: String,
},
RPop {
key: String,
},
LRange {
key: String,
start: i64,
stop: i64,
},
LLen {
key: String,
},
Type {
key: String,
},
ZAdd {
key: String,
flags: ZAddFlags,
members: Vec<(f64, String)>,
},
ZRem {
key: String,
members: Vec<String>,
},
ZScore {
key: String,
member: String,
},
ZRank {
key: String,
member: String,
},
ZCard {
key: String,
},
ZRange {
key: String,
start: i64,
stop: i64,
with_scores: bool,
},
HSet {
key: String,
fields: Vec<(String, Bytes)>,
},
HGet {
key: String,
field: String,
},
HGetAll {
key: String,
},
HDel {
key: String,
fields: Vec<String>,
},
HExists {
key: String,
field: String,
},
HLen {
key: String,
},
HIncrBy {
key: String,
field: String,
delta: i64,
},
HKeys {
key: String,
},
HVals {
key: String,
},
HMGet {
key: String,
fields: Vec<String>,
},
SAdd {
key: String,
members: Vec<String>,
},
SRem {
key: String,
members: Vec<String>,
},
SMembers {
key: String,
},
SIsMember {
key: String,
member: String,
},
SCard {
key: String,
},
ClusterInfo,
ClusterNodes,
ClusterSlots,
ClusterKeySlot {
key: String,
},
ClusterMyId,
ClusterSetSlotImporting {
slot: u16,
node_id: String,
},
ClusterSetSlotMigrating {
slot: u16,
node_id: String,
},
ClusterSetSlotNode {
slot: u16,
node_id: String,
},
ClusterSetSlotStable {
slot: u16,
},
ClusterMeet {
ip: String,
port: u16,
},
ClusterAddSlots {
slots: Vec<u16>,
},
ClusterDelSlots {
slots: Vec<u16>,
},
ClusterForget {
node_id: String,
},
ClusterReplicate {
node_id: String,
},
ClusterFailover {
force: bool,
takeover: bool,
},
ClusterCountKeysInSlot {
slot: u16,
},
ClusterGetKeysInSlot {
slot: u16,
count: u32,
},
Migrate {
host: String,
port: u16,
key: String,
db: u32,
timeout_ms: u64,
copy: bool,
replace: bool,
},
Asking,
Unknown(String),
}Expand description
A parsed client command, ready for execution.
Variants§
Ping(Option<Bytes>)
PING with an optional message. Returns PONG or echoes the message.
Echo(Bytes)
ECHO
Get
GET
Set
SET
Fields
Incr
INCR
Decr
DECR
Del
DEL
Exists
EXISTS
MGet
MGET
MSet
MSET
Expire
EXPIRE
Ttl
TTL
Persist
PERSIST
Pttl
PTTL
Pexpire
PEXPIRE
DbSize
DBSIZE. Returns the number of keys in the database.
Info
INFO [section]. Returns server info. Currently only supports “keyspace”.
BgSave
BGSAVE. Triggers a background snapshot.
BgRewriteAof
BGREWRITEAOF. Triggers an AOF rewrite (snapshot + truncate).
FlushDb
FLUSHDB. Removes all keys from the database.
Scan
SCAN
LPush
LPUSH
RPush
RPUSH
LPop
LPOP
RPop
RPOP
LRange
LRANGE
LLen
LLEN
Type
TYPE
ZAdd
ZADD
ZRem
ZREM
ZScore
ZSCORE
ZRank
ZRANK
ZCard
ZCARD
ZRange
ZRANGE
HSet
HSET
HGet
HGET
HGetAll
HGETALL
HDel
HDEL
HExists
HEXISTS
HLen
HLEN
HIncrBy
HINCRBY
HKeys
HKEYS
HVals
HVALS
HMGet
HMGET
SAdd
SADD
SRem
SREM
SMembers
SMEMBERS
SIsMember
SISMEMBER
SCard
SCARD
ClusterInfo
CLUSTER INFO. Returns cluster state and configuration information.
ClusterNodes
CLUSTER NODES. Returns the list of cluster nodes.
ClusterSlots
CLUSTER SLOTS. Returns the slot distribution across nodes.
ClusterKeySlot
CLUSTER KEYSLOT
ClusterMyId
CLUSTER MYID. Returns the node’s ID.
ClusterSetSlotImporting
CLUSTER SETSLOT
ClusterSetSlotMigrating
CLUSTER SETSLOT
ClusterSetSlotNode
CLUSTER SETSLOT
ClusterSetSlotStable
CLUSTER SETSLOT
ClusterMeet
CLUSTER MEET
ClusterAddSlots
CLUSTER ADDSLOTS
ClusterDelSlots
CLUSTER DELSLOTS
ClusterForget
CLUSTER FORGET
ClusterReplicate
CLUSTER REPLICATE
ClusterFailover
CLUSTER FAILOVER [FORCE|TAKEOVER]. Trigger a manual failover.
ClusterCountKeysInSlot
CLUSTER COUNTKEYSINSLOT
ClusterGetKeysInSlot
CLUSTER GETKEYSINSLOT
Migrate
MIGRATE
Asking
ASKING. Signals that the next command is for a migrating slot.
Unknown(String)
A command we don’t recognize (yet).