[][src]Trait reool::RedisOps

pub trait RedisOps: 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, Duration> { ... }
fn flushall<'a>(&'a mut self) -> RedisFuture<'a, ()> { ... }
fn flushall_async<'a>(&'a mut self) -> RedisFuture<'a, ()> { ... }
fn quit<'a>(&'a mut self) -> RedisFuture<'a, ()> { ... }
fn client_id<'a>(&'a mut self) -> RedisFuture<i64> { ... }
fn client_kill_id<'a>(&'a mut self, id: i64) -> RedisFuture<()> { ... }
fn db_size<'a>(&'a mut self) -> RedisFuture<i64> { ... } }

A helper trait to easily execute common asynchronous Redis operations 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, Duration>

Send a ping command and return the roundrip time if successful

fn flushall<'a>(&'a mut self) -> RedisFuture<'a, ()>

Delete all the keys of all the existing databases, not just the currently selected one. This command never fails.

The time-complexity for this operation is O(N), N being the number of keys in all existing databases.

fn flushall_async<'a>(&'a mut self) -> RedisFuture<'a, ()>

Delete all the keys of all the existing databases

Redis (since 4.0,0) is now able to delete keys in the background in a different thread without blocking the server. An ASYNC option was added to FLUSHALL and FLUSHDB in order to let the entire dataset or a single database to be freed asynchronously.

Asynchronous FLUSHALL and FLUSHDB commands only delete keys that were present at the time the command was invoked. Keys created during an asynchronous flush will be unaffected.

fn quit<'a>(&'a mut self) -> RedisFuture<'a, ()>

Ask the server to close the connection.

The connection is closed as soon as all pending replies have been written to the client.

fn client_id<'a>(&'a mut self) -> RedisFuture<i64>

fn client_kill_id<'a>(&'a mut self, id: i64) -> RedisFuture<()>

fn db_size<'a>(&'a mut self) -> RedisFuture<i64>

Determine the number of keys.

Loading content...

Implementors

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

Loading content...