4 stable releases

2.0.7 Oct 22, 2023
2.0.5 Sep 20, 2023
2.0.4 May 23, 2023
2.0.3 May 4, 2023

#1906 in Database interfaces

Download history 329/week @ 2024-01-04 409/week @ 2024-01-11 293/week @ 2024-01-18 255/week @ 2024-01-25 305/week @ 2024-02-01 345/week @ 2024-02-08 306/week @ 2024-02-15 355/week @ 2024-02-22 380/week @ 2024-02-29 409/week @ 2024-03-07 497/week @ 2024-03-14 340/week @ 2024-03-21 496/week @ 2024-03-28 291/week @ 2024-04-04 344/week @ 2024-04-11 240/week @ 2024-04-18

1,431 downloads per month

BSD-3-Clause

41KB
582 lines

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

~1.3–1.8MB
~42K SLoC