48 releases (16 breaking)

Uses new Rust 2024

0.19.1 Jan 19, 2026
0.18.0 Jan 8, 2026
0.17.0 Dec 17, 2025
0.16.2 Nov 10, 2025
0.7.1 Dec 30, 2022

#81 in Database interfaces

Download history 1027/week @ 2025-10-23 1630/week @ 2025-10-30 1387/week @ 2025-11-06 1114/week @ 2025-11-13 925/week @ 2025-11-20 611/week @ 2025-11-27 970/week @ 2025-12-04 712/week @ 2025-12-11 644/week @ 2025-12-18 265/week @ 2025-12-25 753/week @ 2026-01-01 807/week @ 2026-01-08 823/week @ 2026-01-15 1191/week @ 2026-01-22 1305/week @ 2026-01-29 1021/week @ 2026-02-05

4,524 downloads per month
Used in 6 crates

Custom license

1.5MB
34K SLoC

An asynchronous Redis client for Rust.

Crate docs.rs Build License libs.tech recommends

Documentation

Official Documentation

Philosophy

  • Low allocations
  • Full async library
  • Lock free implementation
  • Rust idiomatic API
  • Multiplexing as a core feature

Features

Protocol Compatibility

Rustis uses the RESP3 protocol exclusively.

The HELLO 3 command is automatically sent when establishing a connection.
Therefore, your Redis server must support RESP3 (Redis ≥6.0+ with RESP3 enabled).

If you use Redis 5 or older, or your Redis 6+ server still defaults to RESP2,
Rustis will not work.

To verify your server supports RESP3:

redis-cli --raw HELLO 3

If you see server info (role, version, etc.), you're good to go. If you get an error, upgrade Redis.

Basic Usage

use rustis::{
     client::Client, 
     commands::{FlushingMode, ServerCommands, StringCommands},
     Result,
};

#[tokio::main]
async fn main() -> Result<()> {
     // Connect the client to a Redis server from its IP and port
     let client = Client::connect("127.0.0.1:6379").await?;
 
     // Flush all existing data in Redis
     client.flushdb(FlushingMode::Sync).await?;

     // sends the command SET to Redis. This command is defined in the StringCommands trait
     client.set("key", "value").await?;
 
     // sends the command GET to Redis. This command is defined in the StringCommands trait
     let value: String = client.get("key").await?;
     println!("value: {value:?}");

     Ok(())
}

Tests

  1. From the redis directory, run docker_up.sh or docker_up.cmd
  2. run cargo test --features pool,tokio-rustls,json,client-cache (Tokio runtime)
  3. run cargo test --no-default-features --features async-std-runtime,async-std-native-tls,json,client-cache (async-std runtime)
  4. run cargo fmt --all -- --check

Benchmarks

  1. From the redis directory, run docker_up.sh or docker_up.cmd
  2. run cargo bench

Dependencies

~8–33MB
~471K SLoC