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.
```rust use iredismodule_macros::rcmd; use iredismodule::prelude::*;
/// Define command
fn simplehello(ctx: &mut Context, _args: Vec
// Register module definemodule! { name: "simple", version: 1, datatypes: [], initfuncs: [], commands: [ simplehello_cmd, ] } ```
cargo build --example helloworld
helloworld
module
redis-server --loadmodule ./target/debug/examples/helloworld.so
redis-server --loadmodule ./target/debug/examples/helloworld.dylib
HELLO.SIMPLE
. 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.