redis-cell-rs
Description
This crate provides Rust bindings for the Redis Cell module.
You can define a rate-limiting Policy in quite a few ways:
use Policy;
use Duration;
const POLICY1: Policy = from_tokens_per_second;
const POLICY2: Policy = from_tokens_per_minute;
const POLICY3: Policy = from_tokens_per_hour;
const POLICY4: Policy = from_tokens_per_day;
const POLICY5: Policy = from_tokens_per_period
.max_burst
.apply_tokens
.name;
const POLICY6: Policy = new;
A policy can now be used to crate rate-limiting request (command), which - in
its turn - can be turned into a Redis command and sent over to the server using
a Redis client. The response can then be converted into Verdict.
use Policy;
use ;
use ;
const POLICY1: Policy = from_tokens_per_second;
let cmd: RedisCmd = new.into;
let client = open.unwrap;
let mut con = client.get_connection.unwrap;
let verdict: Verdict = cmd.query.unwrap;
match verdict
Development & Contributing
Please find utility commands in Makefile.