Fred
An async client for Redis and Valkey
Example
use fred::prelude::*;
#[tokio::main]
async fn main() -> Result<(), RedisError> {
let client = RedisClient::default();
client.init().await?;
// convert responses to many common Rust types
let foo: Option<String> = client.get("foo").await?;
assert!(foo.is_none());
client.set("foo", "bar", None, None, false).await?;
// or use turbofish to declare response types
println!("Foo: {:?}", client.get::<String, _>("foo").await?);
client.quit().await?;
Ok(())
}
See the examples…