Trait redis_driver::CommandSend
source · [−]pub trait CommandSend {
fn send(
&self,
command: Command
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + '_>>;
fn send_into<T: FromValue>(
&self,
command: Command
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + '_>> { ... }
fn send_into_tuple_vec<T: FromValue, U: FromValue>(
&self,
command: Command
) -> Pin<Box<dyn Future<Output = Result<Vec<(T, U)>>> + Send + '_>> { ... }
}
Required Methods
Send an arbitrary command to the server.
This is used primarily intended for implementing high level commands API but may also be used to provide access to new features that lack a direct API.
Arguments
name
- Command name in uppercase.args
- Command arguments which can be provided as arrays (up to 4 elements) or vectors of BulkString.
Example
ⓘ
let connection = ConnectionMultiplexer::connect("127.0.0.1:6379").await?;
let database = connection.get_default_database();
let values: Vec<String> = database
.send(cmd("MGET").arg("key1").arg("key2").arg("key3").arg("key4"))
.await?
.into()?;