Skip to main content

rate_limit

Function rate_limit 

Source
pub fn rate_limit(
    limiter: RateLimiter,
) -> impl Fn(Request, Next) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'static>> + Clone + Send + Sync + 'static
Expand description

The middleware function. Wrap a limiter into a closure and hand it to Router::middleware(...).