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§