runlimit-memory 0.2.0

Hard-bounded in-memory fixed-window and GCRA rate limiting
Documentation
//! Hard-bounded, process-local rate-limit storage.
//!
//! [`MemoryStore`] implements the same anchored fixed-window model as the
//! `PostgreSQL` backend. [`GcraStore`] implements a continuously replenished
//! generic-cell-rate-algorithm model for process-local use. Both stores
//! deliberately refuse to evict live entries. When a shard is full, a new
//! subject is denied until bounded cleanup frees space. An atomic batch that
//! can never fit in one shard returns a structural [`MemoryStoreError`] instead
//! of a retryable capacity denial. Both stores implement
//! [`runlimit_core::Limiter`] for async generic adapters while retaining their
//! synchronous inherent check methods.
//!
//! The optional `serde` feature enables validated [`MemoryStoreConfig`]
//! loading, read-only [`MemoryStoreStats`] serialization, and the corresponding
//! `runlimit-core` metadata feature.

mod clock;
mod config;
mod gcra;
mod store;

pub use clock::{Clock, SystemClock};
pub use config::{MemoryStoreConfig, MemoryStoreConfigError};
pub use gcra::GcraStore;
pub use store::{MemoryStore, MemoryStoreError, MemoryStoreStats};