Expand description
High-performance async Redis client for Rust
redis-oxide is a Redis client library similar to StackExchange.Redis for .NET.
It automatically detects whether you’re connecting to a standalone Redis server
or a Redis Cluster, and handles MOVED/ASK redirects transparently.
§Features
- Automatic topology detection (Standalone vs Cluster)
- Transparent handling of MOVED and ASK redirects
- Multiple connection strategies (multiplexed, pooled)
- Type-safe command builders
- Async/await support with Tokio
- Comprehensive error handling
§Quick Start
use redis_oxide::{Client, ConnectionConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = ConnectionConfig::new("redis://localhost:6379");
let client = Client::connect(config).await?;
client.set("mykey", "myvalue").await?;
let value: Option<String> = client.get("mykey").await?;
println!("Value: {:?}", value);
Ok(())
}Re-exports§
pub use client::Client;pub use crate::core::config::ConnectionConfig;pub use crate::core::config::PoolConfig;pub use crate::core::config::PoolStrategy;pub use crate::core::config::TopologyMode;pub use crate::core::error::RedisError;pub use crate::core::error::RedisResult;pub use crate::core::types::NodeInfo;pub use crate::core::types::RedisValue;pub use crate::core::types::SlotRange;pub use crate::core::value::RespValue;