runlimit_memory/lib.rs
1//! Hard-bounded, process-local rate-limit storage.
2//!
3//! [`MemoryStore`] implements the same anchored fixed-window model as the
4//! `PostgreSQL` backend. [`GcraStore`] implements a continuously replenished
5//! generic-cell-rate-algorithm model for process-local use. Both stores
6//! deliberately refuse to evict live entries. When a shard is full, a new
7//! subject is denied until bounded cleanup frees space. An atomic batch that
8//! can never fit in one shard returns a structural [`MemoryStoreError`] instead
9//! of a retryable capacity denial. Both stores implement
10//! [`runlimit_core::Limiter`] for async generic adapters while retaining their
11//! synchronous inherent check methods.
12//!
13//! The optional `serde` feature enables validated [`MemoryStoreConfig`]
14//! loading, read-only [`MemoryStoreStats`] serialization, and the corresponding
15//! `runlimit-core` metadata feature.
16
17mod clock;
18mod config;
19mod gcra;
20mod store;
21
22pub use clock::{Clock, SystemClock};
23pub use config::{MemoryStoreConfig, MemoryStoreConfigError};
24pub use gcra::GcraStore;
25pub use store::{MemoryStore, MemoryStoreError, MemoryStoreStats};