Command

Trait Command 

Source
pub trait Command {
    type Output;

    // Required methods
    fn command_name(&self) -> &str;
    fn args(&self) -> Vec<RespValue>;
    fn parse_response(&self, response: RespValue) -> RedisResult<Self::Output>;
    fn keys(&self) -> Vec<&[u8]>;
}
Expand description

Trait for commands that can be executed

Required Associated Types§

Source

type Output

The return type of the command

Required Methods§

Source

fn command_name(&self) -> &str

Get the command name

Source

fn args(&self) -> Vec<RespValue>

Get the command arguments

Source

fn parse_response(&self, response: RespValue) -> RedisResult<Self::Output>

Parse the response into the output type

Source

fn keys(&self) -> Vec<&[u8]>

Get the key(s) involved in this command (for cluster routing)

Implementors§

Source§

impl Command for HDelCommand

Source§

impl Command for HExistsCommand

Source§

impl Command for HGetAllCommand

Source§

impl Command for HGetCommand

Source§

impl Command for HLenCommand

Source§

impl Command for HMGetCommand

Source§

impl Command for HMSetCommand

Source§

impl Command for HSetCommand

Source§

impl Command for LIndexCommand

Source§

impl Command for LLenCommand

Source§

impl Command for LPopCommand

Source§

impl Command for LPushCommand

Source§

impl Command for LRangeCommand

Source§

impl Command for LSetCommand

Source§

impl Command for RPopCommand

Source§

impl Command for RPushCommand

Source§

impl Command for OptimizedGetCommand

Source§

impl Command for OptimizedHSetCommand

Source§

impl Command for OptimizedSetCommand

Source§

impl Command for SAddCommand

Source§

impl Command for SCardCommand

Source§

impl Command for SIsMemberCommand

Source§

impl Command for SMembersCommand

Source§

impl Command for SPopCommand

Source§

impl Command for SRandMemberCommand

Source§

impl Command for SRemCommand

Source§

impl Command for ZAddCommand

Source§

impl Command for ZCardCommand

Source§

impl Command for ZRangeCommand

Source§

impl Command for ZRankCommand

Source§

impl Command for ZRemCommand

Source§

impl Command for ZRevRankCommand

Source§

impl Command for ZScoreCommand

Source§

impl Command for DecrByCommand

Source§

impl Command for DecrCommand

Source§

impl Command for DelCommand

Source§

impl Command for ExistsCommand

Source§

impl Command for ExpireCommand

Source§

impl Command for GetCommand

Source§

impl Command for IncrByCommand

Source§

impl Command for IncrCommand

Source§

impl Command for SetCommand

Source§

impl Command for TtlCommand