Show HN: Redis-cell, an API rate limiter as a Redis module, written in Rust
github.com
github.com
Redis provides a fairly novel API for plugging into it in that instead of using a shared object (.so), it's only exposed as a C header file. To compensate for this in a non-C language, I have a build step that compiles a library for Rust to link against [4]. It was a pleasant surprise to find that this functionality is built right into Rust's compiler.
[1] https://github.com/antirez/redis/blob/unstable/src/modules/I...
[2] https://doc.rust-lang.org/book/ffi.html
[3] https://gist.github.com/brandur/90698498bd543598d00df46e32be...
[4] https://github.com/brandur/redis-cell/blob/master/build.rs