Expand description
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 (wrapped
by GcraStoreError for GCRA admission) 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.
Structs§
- Gcra
Store - A hard-bounded, process-local generic-cell-rate-algorithm store.
- Memory
Store - A sharded, hard-bounded, process-local fixed-window store.
- Memory
Store Config - Configuration for a hard-bounded
MemoryStore. - Memory
Store Stats - Current bounded-store usage.
- System
Clock - A monotonic clock backed by
Instant.
Enums§
- Gcra
Store Error - Failure from a GCRA memory-store admission operation.
- Memory
Store Config Error - Invalid in-memory store configuration.
- Memory
Store Error - A fail-closed in-memory store error.
Traits§
- Clock
- Supplies monotonic elapsed time to a
MemoryStore.