MCPcopy Index your code
hub / github.com/dahomey-technologies/rustis

github.com/dahomey-technologies/rustis @0.19.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.19.3 ↗ · + Follow
2,436 symbols 10,029 edges 139 files 225 documented · 9% updated 40d ago0.19.3 · 2026-03-27★ 1001 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

Extension points exported contracts — how you extend this code

IntoConfig (Interface)
A value-to-[`Config`](crate::client::Config) conversion that consumes the input value. This allows the `connect` associ [5 …
src/client/config.rs
VectorSetCommands (Interface)
A group of Redis commands related to [`Vector Sets`](https://redis.io/docs/data-types/vector-sets/) # See Also [Redis S [4 …
src/commands/vector_set.rs
Response (Interface)
Marker for a RESP Response [1 implementers]
src/resp/response.rs
BatchPreparedCommand (Interface)
Extension trait dedicated to [`PreparedCommand`](crate::client::PreparedCommand) to add specific methods for the [`Pipel [2 …
src/client/pipeline.rs
ClusterCommands (Interface)
A group of Redis commands related to [`Cluster Management`](https://redis.io/docs/management/scaling/) # See Also [Redis [4 …
src/commands/cluster_commands.rs
ClientPreparedCommand (Interface)
Extension trait dedicated to [`PreparedCommand`](crate::client::PreparedCommand) to add specific methods for the [`Clien [1 …
src/client/client.rs
StreamCommands (Interface)
A group of Redis commands related to [`Streams`](https://redis.io/docs/data-types/streams/) # See Also [Redis Generic Co [4 …
src/commands/stream_commands.rs
ServerCommands (Interface)
A group of Redis commands related to Server Management # See Also [Redis Server Management Commands](https://redis.io/co [4 …
src/commands/server_commands.rs

Core symbols most depended-on inside this repo

arg
called by 793
src/commands/server_commands.rs
cmd
called by 528
src/resp/command.rs
prepare_command
called by 510
src/client/prepared_command.rs
key
called by 291
src/commands/generic_commands.rs
set
called by 182
src/commands/bitmap_commands.rs
flushall
called by 178
src/commands/server_commands.rs
del
called by 132
src/commands/generic_commands.rs
iter
called by 91
src/resp/command_args.rs

Shape

Method 1,373
Function 662
Class 263
Enum 105
Interface 33

Languages

Rust100%

Modules by API surface

src/commands/search_commands.rs182 symbols
src/commands/server_commands.rs125 symbols
src/commands/stream_commands.rs65 symbols
src/commands/time_series_commands.rs64 symbols
src/tests/server_commands.rs62 symbols
src/commands/connection_commands.rs62 symbols
src/commands/generic_commands.rs60 symbols
src/resp/resp_deserializer.rs55 symbols
src/commands/sorted_set_commands.rs54 symbols
src/resp/fast_path_command_builder.rs49 symbols
src/network/cluster_connection.rs49 symbols
src/resp/value_deserializer.rs48 symbols

For agents

$ claude mcp add rustis \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page