[][src]Trait reool::Commands

pub trait Commands: Sized + ConnectionLike + Send + 'static {
    fn query<T>(self, cmd: &Cmd) -> RedisFuture<(Self, T)>
    where
        T: FromRedisValue + Send + 'static
, { ... }
fn execute<T>(self, cmd: &Cmd) -> RedisFuture<(Self, ())>
    where
        T: FromRedisValue + Send + 'static
, { ... }
fn ping(self) -> RedisFuture<(Self, ())> { ... }
fn keys<K: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
        self,
        key: K
    ) -> RedisFuture<(Self, RV)> { ... }
fn get<K: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
        self,
        key: K
    ) -> RedisFuture<(Self, RV)> { ... }
fn set<K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
        self,
        key: K,
        value: V
    ) -> RedisFuture<(Self, RV)> { ... }
fn set_nx<K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
        self,
        key: K,
        value: V
    ) -> RedisFuture<(Self, RV)> { ... }
fn set_multiple<K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
        self,
        items: &[(K, V)]
    ) -> RedisFuture<(Self, RV)> { ... }
fn set_multiple_nx<K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
        self,
        items: &[(K, V)]
    ) -> RedisFuture<(Self, RV)> { ... }
fn del<K: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
        self,
        key: K
    ) -> RedisFuture<(Self, RV)> { ... }
fn exists<K: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
        self,
        key: K
    ) -> RedisFuture<(Self, RV)> { ... }
fn db_size<K: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
        self,
        key: K
    ) -> RedisFuture<(Self, RV)> { ... } }

A helper trait to easily execute common asynchronous Redis commands on a redis::async::ConnectionLike

Provided methods

fn query<T>(self, cmd: &Cmd) -> RedisFuture<(Self, T)> where
    T: FromRedisValue + Send + 'static, 

Execute a command and expect a result

fn execute<T>(self, cmd: &Cmd) -> RedisFuture<(Self, ())> where
    T: FromRedisValue + Send + 'static, 

Execute a command and do not expect a result and instead just check whether the command did not fail

fn ping(self) -> RedisFuture<(Self, ())>

Send a ping command.

fn keys<K: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
    self,
    key: K
) -> RedisFuture<(Self, RV)>

Gets all keys matching pattern

fn get<K: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
    self,
    key: K
) -> RedisFuture<(Self, RV)>

Get the value of a key. If key is a vec this becomes an MGET.

fn set<K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
    self,
    key: K,
    value: V
) -> RedisFuture<(Self, RV)>

Set the string value of a key.

fn set_nx<K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
    self,
    key: K,
    value: V
) -> RedisFuture<(Self, RV)>

Set the value of a key, only if the key does not exist

fn set_multiple<K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
    self,
    items: &[(K, V)]
) -> RedisFuture<(Self, RV)>

Sets multiple keys to their values.

fn set_multiple_nx<K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
    self,
    items: &[(K, V)]
) -> RedisFuture<(Self, RV)>

Sets multiple keys to their values failing if at least one already exists.

fn del<K: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
    self,
    key: K
) -> RedisFuture<(Self, RV)>

Delete one or more keys.

fn exists<K: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
    self,
    key: K
) -> RedisFuture<(Self, RV)>

Determine if one or more keys exist.

fn db_size<K: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
    self,
    key: K
) -> RedisFuture<(Self, RV)>

Determine the number of keys.

Loading content...

Implementors

impl<T> Commands for T where
    T: ConnectionLike + Sized + Send + 'static, 
[src]

Loading content...