Skip to main content

Crate actix_route_rate_limiter

Crate actix_route_rate_limiter 

Source
Expand description

§Actix Route Rate Limiter

Actix Route Rate Limiter implements the traits necessary to create middleware in the Actix Web framework.

This crate can be used to wrap routes with rate limiting logic by defining a duration and number of requests that will be forwarded during that duration.

If a quantity of requests exceeds this amount, the middleware will short circuit the request and instead send an HTTP 429 - Too Many Requests response with headers describing the rate limit:

  • Retry-After : the rate-limiting duration, begins at first request received and ends after this elapsed time
  • X-RateLimit-Limit : number of requests allowed for the duration
  • X-RateLimit-Remaining : number of requests remaining for current duration
  • X-RateLimit-Reset : number of seconds remaining in the duration

Structs§

Limiter
LimiterBuilder
RateLimiter
RateLimiterMiddleware
TimeCount