Redis CLI.
git clone https://github.com/iorust/redis-cli.git && cd redis-cli && cargo build --releasetarget/release/redis-cli -h 127.0.0.1 -p 6379More help:
target/release/redis-cli --helpextern crate redis_cli;
// exports:
use redis_cli::{create_client, Client, COMMANDS, Value, encode_slice, Decoder};Re-exports from the https://github.com/iorust/resp
let mut client = create_client("127.0.0.1", 6379, "", 0).expect("Failed to connect");
client.cmd(&["set", "test", "hello!"]).unwrap();struct Client {
// some fields omitted
}let mut client = Client::new((hostname, port));client.cmd(&["get", "test"]).unwrap(); // Value::String("hello!")Some commands will have one more replies. This method use to read them.
client.read_more().unwrap();https://github.com/iorust/redis-cli/blob/master/src/command.rs