use std::error::Error; use redis::AsyncCommands; use redis_async_pool::{RedisConnectionManager, RedisPool}; #[tokio::main] async fn main() -> Result<(), Box> { let pool = RedisPool::new( RedisConnectionManager::new(redis::Client::open("redis://localhost:6379")?, true, None), 5, ); let mut con = pool.get().await?; con.set(b"key", b"value").await?; let value: Vec = con.get(b"key").await?; assert_eq!(value, b"value"); let exists: bool = con.exists(b"key").await?; println!("Key `key` exists? {}", exists); Ok(()) }