pub trait RedisOps:
Sized
+ ConnectionLike
+ Send
+ 'static {
// Provided methods
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> { ... }
}
Expand description
A helper trait to easily execute common
asynchronous Redis operations on a
redis::aio::ConnectionLike
Provided Methods§
Sourcefn query<'a, T>(&'a mut self, cmd: &'a Cmd) -> RedisFuture<'a, T>where
T: FromRedisValue + Send + 'static,
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
Sourcefn execute<'a, T>(&'a mut self, cmd: &'a Cmd) -> RedisFuture<'a, ()>where
T: FromRedisValue + Send + 'static,
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
Sourcefn ping<'a>(&'a mut self) -> RedisFuture<'a, Duration>
fn ping<'a>(&'a mut self) -> RedisFuture<'a, Duration>
Send a ping command and return the roundrip time if successful
Sourcefn flushall<'a>(&'a mut self) -> RedisFuture<'a, ()>
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.
Sourcefn flushall_async<'a>(&'a mut self) -> RedisFuture<'a, ()>
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.
Sourcefn quit<'a>(&'a mut self) -> RedisFuture<'a, ()>
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<'_, ()>
Sourcefn db_size<'a>(&'a mut self) -> RedisFuture<'_, i64>
fn db_size<'a>(&'a mut self) -> RedisFuture<'_, i64>
Determine the number of keys.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.