use super::*;
#[derive(Debug)]
pub(crate) struct KeyEntry {
pub(crate) state: AtomicU64,
pub(crate) last_seen_ns: AtomicU64,
}
#[repr(align(64))]
#[derive(Debug)]
pub(crate) struct KeyedShard<K> {
pub(crate) map: RwLock<HashMap<K, KeyEntry, FastBuildHasher>>,
}
#[derive(Debug)]
pub struct KeyedRateLimiter<K> {
pub(crate) policy: RateLimitPolicy,
pub(crate) clock: MonotonicClock,
pub(crate) hasher: FastBuildHasher,
pub(crate) max_entries: usize,
pub(crate) per_shard_capacity: usize,
pub(crate) shards: Box<[KeyedShard<K>]>,
}