MCPcopy Index your code
hub / github.com/RedisLabsModules/redismodule-rs

github.com/RedisLabsModules/redismodule-rs @v2.1.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.1.3 ↗ · + Follow
678 symbols 1,314 edges 65 files 112 documented · 17%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

license Releases crates.io docs CircleCI

redismodule-rs

This crate provides an idiomatic Rust API for the Redis Modules API. It allows writing Redis modules in Rust, without needing to use raw pointers or unsafe code. See here for the most recent API documentation.

Running the example module

  1. Install Rust
  2. Install Redis, most likely using your favorite package manager (Homebrew on Mac, APT or YUM on Linux)
  3. Run cargo build --example hello
  4. Start a redis server with the hello module
  5. Linux: redis-server --loadmodule ./target/debug/examples/libhello.so
  6. Mac: redis-server --loadmodule ./target/debug/examples/libhello.dylib
  7. Open a Redis CLI, and run HELLO.MUL 31 11.

Writing your own module

See the examples directory for some sample modules.

This crate tries to provide high-level wrappers around the standard Redis Modules API, while preserving the API's basic concepts. Therefore, following the Redis Modules API documentation will be mostly relevant here as well.

Redis Modules based on this crate

The following are some modules that are built on this crate:

Several member of the community have written their own modules based on this.

Extension points exported contracts — how you extend this code

RedisLockIndicator (Interface)
Whenever the user gets a reference to a struct that implements this trait, it can assume that the Redis GIL is held. Any [5 …
src/context/thread_safe.rs
ConfigurationValue (Interface)
(no doc) [6 implementers]
src/configuration.rs
NextArg (Interface)
(no doc) [1 implementers]
src/redismodule.rs
EnumConfigurationValue (Interface)
(no doc)
src/configuration.rs

Core symbols most depended-on inside this repo

iter
called by 62
src/context/call_reply.rs
into_iter
called by 52
src/key.rs
to_string
called by 48
src/redismodule.rs
is_null
called by 35
src/key.rs
len
called by 34
src/redismodule.rs
clone
called by 30
src/redismodule.rs
field
called by 29
src/context/mod.rs
as_ref
called by 25
src/redismodule.rs

Shape

Function 274
Method 247
Class 119
Enum 34
Interface 4

Languages

Rust94%
C++5%
C1%

Modules by API surface

src/context/mod.rs93 symbols
src/raw.rs85 symbols
src/redismodule.rs46 symbols
src/key.rs44 symbols
src/context/call_reply.rs43 symbols
src/include/redismodule.h37 symbols
src/configuration.rs28 symbols
tests/integration.rs27 symbols
src/context/commands.rs21 symbols
redismodule-rs-macros/src/command.rs19 symbols
src/logging.rs15 symbols
src/context/thread_safe.rs15 symbols

For agents

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

⬇ download graph artifact