Reference
API Reference Guide
Map of v2 providers, configuration types, decisions, reads, updates, and key lifecycle.
This page is a compact API map. The linked concept pages explain behavior and tradeoffs; generated docs.rs documentation contains exhaustive signatures and constructor lists.

Providers
| Provider | Construction | Keys | Calls |
|---|---|---|---|
LocalRateLimiterProvider | builder() | &str | synchronous |
RedisRateLimiterProvider | builder(connection) | &RedisKey | async |
HybridRateLimiterProvider | builder(connection) | &RedisKey | async |
Each provider exposes .absolute() and .suppressed().
Shared types
| Type | Role |
|---|---|
RateLimiterBuilder | shared builder trait |
RateLimit | validated rate, normalized per second |
WindowSize, BucketSize | live-history duration and grouping precision |
HardLimitFactor | multiplier from soft target to full suppression |
SuppressionFactorCachePeriod | suppression-factor cache duration |
RateLimitDecision | admission result and rejection metadata |
SuppressedRateLimitSnapshot | suppressed live read |
RateLimitComparator | guard over the current live total |
HistoryPreservation | newest/oldest retention policy |
ConditionalSetOutcome | match status and before/after totals |
RedisKey | validated Redis/hybrid namespace or subject key |
SyncInterval | hybrid synchronization cadence |
Operations
inc(...): establish admission, then record allowed usage.is_allowed(...): absolute admission check without increment.get(...): live total or suppressed snapshot; unknown keys return zero without insertion.get_suppression_factor(...): suppressed pressure; unknown keys return0.0.set_rate_limit(...): update an existing sticky rate without replacing live history.delete(...): remove one key and return its live absolute or accepted suppressed usage.clear(): remove every key for the called strategy under its configured prefix.set_if(...): comparator-gated history replacement.set_if_preserve_history(...): comparator-gated update retaining newest or oldest history.- Hybrid
get_estimate(...): local estimate when state permits, Redis refresh otherwise.
Reads may lazily evict expired buckets. Matched zero conditional updates remove state. Absolute admission remains best-effort under concurrency.

