Modules
errorThe error type shared by every rate limit and store.key`Key`: the name a limit counts under, a pattern with placeholders.recaptcha`ReCaptcha`: asks Google whether a reCAPTCHA token came from a person.redis_connRedis plumbing shared by the Redis stores: replies as phpredis reports them, key scans, and the `Pool` the `RedisPool` stores borrow from.sliding_windowSliding windows: the current window's count plus the previous window's, weighted by how much of it the sliding window still covers.time_limitFixed windows: at most `limit` requests per key in each window of `seconds`, the windows aligned on the Unix epoch.token_bucketToken buckets: a key holds up to `tokens` tokens, refilled at `refill_rate` a second; each request takes one.
Contents
use utopia_abuse::Verdict;Rust
pub struct VerdictWhat a limit says about a request.
use utopia_abuse::Adapter;Rust
pub trait Adapter: Send + SyncA rate limit on one key.
TimeLimit, SlidingWindow and TokenBucket implement it over any
of their stores.