30 releases (6 stable)

2.0.7 Oct 22, 2023
2.0.4 May 23, 2023
1.0.1 May 31, 2022
1.0.0 Feb 22, 2022
0.5.0 Oct 30, 2019

#102 in Database interfaces

Download history 1631/week @ 2024-03-13 1574/week @ 2024-03-20 2285/week @ 2024-03-27 2335/week @ 2024-04-03 2290/week @ 2024-04-10 1442/week @ 2024-04-17 1390/week @ 2024-04-24 1962/week @ 2024-05-01 1603/week @ 2024-05-08 1762/week @ 2024-05-15 2497/week @ 2024-05-22 2193/week @ 2024-05-29 2309/week @ 2024-06-05 2600/week @ 2024-06-12 1891/week @ 2024-06-19 2183/week @ 2024-06-26

9,411 downloads per month
Used in 5 crates

BSD-3-Clause

255KB
6K SLoC

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
    • Linux: redis-server --loadmodule ./target/debug/examples/libhello.so
    • Mac: redis-server --loadmodule ./target/debug/examples/libhello.dylib
  5. 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.

Dependencies

~8–12MB
~234K SLoC