Skip to main content

Module rate_limit

Module rate_limit 

Source
Expand description

Token-bucket rate limiting middleware.

Provides a per-IP token-bucket rate limiter that can be used as Axum middleware or checked manually in handlers. Disabled by default when RateLimitConfig::enabled is false.

Structs§

RateLimitConfig
Configuration for the token-bucket rate limiter.
RateLimiter
Per-IP token-bucket rate limiter.

Functions§

rate_limit_response
Build a 429 Too Many Requests response with AT-Protocol-style JSON body.