hyperlane-plugin-rate-limit 23.3.1

A 64-way sharded lock-free atomic GCRA and fixed-window rate limiter plugin for the Hyperlane framework with extensible KeyExtractor and RateLimitStore traits and RFC RateLimit headers.
Documentation
//! hyperlane-plugin-rate-limit
//!
//! 64-way sharded lock-free atomic GCRA and fixed-window rate limiter plugin
//! for Hyperlane with extensible [`KeyExtractor`] and [`RateLimitStore`] traits
//! and RFC `RateLimit-*` response headers.

mod r#const;
mod r#enum;
mod r#fn;
mod r#impl;
mod r#static;
mod r#struct;
mod r#trait;
mod r#type;

#[cfg(test)]
#[path = "../tests/mod.rs"]
mod tests;

pub use {r#const::*, r#enum::*, r#struct::*, r#trait::*};

pub(crate) use {r#fn::*, r#static::*, r#type::*};

use std::{
    array::from_fn,
    collections::{HashMap, VecDeque},
    fmt::{self, Write},
    hash::{BuildHasherDefault, Hasher},
    net::{IpAddr, SocketAddr},
    str::from_utf8,
    sync::{
        Arc, OnceLock, RwLock, RwLockReadGuard, RwLockWriteGuard,
        atomic::{AtomicU64, AtomicUsize, Ordering},
    },
    time::Instant,
};

use {
    hyperlane::{
        Context, EMPTY_STR, HttpStatus, RETRY_AFTER, Request, Response, ResponseError, ServerHook,
        Status, Stream, X_FORWARDED_FOR, X_REAL_IP,
    },
    lombok_macros::*,
};