[][src]Trait reool::Commands

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

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

Provided methods

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

Execute a command and expect a result

fn execute<'a, T>(&'a mut self, cmd: &'a Cmd) -> RedisFuture<'a, ()> 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<'a>(&'a mut self) -> RedisFuture<'a, ()>

Send a ping command.

fn keys<'a, K, RV>(&'a mut self, key: K) -> RedisFuture<'a, RV> where
    K: ToRedisArgs + Send + 'a,
    RV: FromRedisValue + Send + 'a, 

Gets all keys matching pattern

fn get<'a, K, RV>(&'a mut self, key: K) -> RedisFuture<'a, RV> where
    K: ToRedisArgs + Send + 'a,
    RV: FromRedisValue + Send + 'a, 

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

fn set<'a, K, V, RV>(&'a mut self, key: K, value: V) -> RedisFuture<'a, RV> where
    K: ToRedisArgs + Send + 'a,
    V: ToRedisArgs + Send + 'a,
    RV: FromRedisValue + Send + 'a, 

Set the string value of a key.

fn set_nx<'a, K, V, RV>(&'a mut self, key: K, value: V) -> RedisFuture<'a, RV> where
    K: ToRedisArgs + Send + 'a,
    V: ToRedisArgs + Send + 'a,
    RV: FromRedisValue + Send + 'a, 

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

fn set_multiple<'a, K, V, RV>(
    &'a mut self,
    items: &'a [(K, V)]
) -> RedisFuture<'a, RV> where
    K: ToRedisArgs + Send + Sync + 'a,
    V: ToRedisArgs + Send + Sync + 'a,
    RV: FromRedisValue + Send + 'a, 

Sets multiple keys to their values.

fn set_multiple_nx<'a, K, V, RV>(
    &'a mut self,
    items: &'a [(K, V)]
) -> RedisFuture<'a, RV> where
    K: ToRedisArgs + Send + Sync + 'a,
    V: ToRedisArgs + Send + Sync + 'a,
    RV: FromRedisValue + Send + 'a, 

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

fn del<'a, K, RV>(&'a mut self, key: K) -> RedisFuture<'a, RV> where
    K: ToRedisArgs + Send + 'a,
    RV: FromRedisValue + Send + 'a, 

Delete one or more keys.

fn exists<'a, K, RV>(&'a mut self, key: K) -> RedisFuture<RV> where
    K: ToRedisArgs + Send + 'a,
    RV: FromRedisValue + Send + 'a, 

Determine if one or more keys exist.

fn db_size<'a, K, RV>(&'a mut self, key: K) -> RedisFuture<RV> where
    K: ToRedisArgs + Send + 'a,
    RV: FromRedisValue + Send + 'a, 

Determine the number of keys.

Loading content...

Implementors

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

Loading content...