[][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_multiple<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)> { ... } }

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_multiple<K: ToRedisArgs, V: ToRedisArgs, RV: FromRedisValue + Send + 'static>(
    self,
    items: &[(K, V)]
) -> RedisFuture<(Self, RV)>

Sets multiple keys to their values.

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 a key exists.

Loading content...

Implementors

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

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

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

fn ping(self) -> RedisFuture<(Self, ())>[src]

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

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

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

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

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

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

Loading content...