[{"data":1,"prerenderedAt":642},["ShallowReactive",2],{"navigation":3,"/changelog/v3-1-0":252,"/changelog/v3-1-0-surround":637},[4,34,66,87,106,145,166,176,204],{"title":5,"path":6,"stem":7,"children":8,"icon":32,"defaultOpen":33},"Getting Started","/getting-started","1.getting-started/1.index",[9,12,17,22,27],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-info",{"title":13,"path":14,"stem":15,"icon":16},"Installation","/getting-started/installation","1.getting-started/2.installation","i-lucide-download",{"title":18,"path":19,"stem":20,"icon":21},"Quickstart (Local)","/getting-started/quickstart-local","1.getting-started/3.quickstart-local","i-lucide-zap",{"title":23,"path":24,"stem":25,"icon":26},"Quickstart (Redis)","/getting-started/quickstart-redis","1.getting-started/4.quickstart-redis","i-lucide-database",{"title":28,"path":29,"stem":30,"icon":31},"Quickstart (Hybrid)","/getting-started/quickstart-hybrid","1.getting-started/5.quickstart-hybrid","i-lucide-arrow-left-right","i-lucide-rocket",true,{"title":35,"icon":36,"defaultOpen":33,"path":37,"stem":38,"children":39,"page":65},"Concepts","i-lucide-lightbulb","/concepts","2.concepts",[40,45,50,55,60],{"title":41,"path":42,"stem":43,"icon":44},"Keys","/concepts/keys","2.concepts/1.keys","i-lucide-key-round",{"title":46,"path":47,"stem":48,"icon":49},"Rate Limits","/concepts/rate-limits","2.concepts/2.rate-limits","i-lucide-badge-percent",{"title":51,"path":52,"stem":53,"icon":54},"Sliding Windows","/concepts/sliding-windows","2.concepts/3.sliding-windows","i-lucide-timer-reset",{"title":56,"path":57,"stem":58,"icon":59},"Decisions","/concepts/decisions","2.concepts/4.decisions","i-lucide-check-check",{"title":61,"path":62,"stem":63,"icon":64},"Configuration Types","/concepts/configuration-types","2.concepts/5.configuration-types","i-lucide-box",false,{"title":67,"icon":68,"defaultOpen":33,"path":69,"stem":70,"children":71,"page":65},"Strategies","i-lucide-git-branch","/strategies","3.strategies",[72,77,82],{"title":73,"path":74,"stem":75,"icon":76},"Absolute","/strategies/absolute","3.strategies/1.absolute","i-lucide-shield",{"title":78,"path":79,"stem":80,"icon":81},"Suppressed","/strategies/suppressed","3.strategies/2.suppressed","i-lucide-activity",{"title":83,"path":84,"stem":85,"icon":86},"How Suppression Works","/strategies/how-suppression-works","3.strategies/3.how-suppression-works","i-lucide-function-square",{"title":88,"icon":89,"defaultOpen":33,"path":90,"stem":91,"children":92,"page":65},"Providers","i-lucide-layers","/providers","4.providers",[93,98,102],{"title":94,"path":95,"stem":96,"icon":97},"Local","/providers/local","4.providers/1.local","i-lucide-cpu",{"title":99,"path":100,"stem":101,"icon":26},"Redis","/providers/redis","4.providers/2.redis",{"title":103,"path":104,"stem":105,"icon":31},"Hybrid","/providers/hybrid","4.providers/3.hybrid",{"title":107,"path":108,"stem":109,"children":110,"icon":76,"defaultOpen":65},"Actix Web","/actix-web","5.actix-web/1.index",[111,113,118,122,127,131,136,140],{"title":112,"path":108,"stem":109,"icon":76},"Overview",{"title":114,"path":115,"stem":116,"icon":117},"Client IPs","/actix-web/client-ips","5.actix-web/2.client-ips","i-lucide-network",{"title":119,"path":120,"stem":121,"icon":44},"Keys and custom extractors","/actix-web/keys","5.actix-web/3.keys",{"title":123,"path":124,"stem":125,"icon":126},"Limits","/actix-web/limits","5.actix-web/4.limits","i-lucide-gauge",{"title":128,"path":129,"stem":130,"icon":26},"Backends","/actix-web/backends","5.actix-web/5.backends",{"title":132,"path":133,"stem":134,"icon":135},"Responses","/actix-web/responses","5.actix-web/6.responses","i-lucide-reply",{"title":137,"path":138,"stem":139,"icon":81},"Observability","/actix-web/observability","5.actix-web/7.observability",{"title":141,"path":142,"stem":143,"icon":144},"Performance","/actix-web/performance","5.actix-web/8.performance","i-lucide-timer",{"title":146,"icon":147,"defaultOpen":65,"path":148,"stem":149,"children":150,"page":65},"Guides","i-lucide-map","/guides","5.guides",[151,156,161],{"title":152,"path":153,"stem":154,"icon":155},"Configuration","/guides/configuration","5.guides/1.configuration","i-lucide-sliders-horizontal",{"title":157,"path":158,"stem":159,"icon":160},"Cleanup","/guides/cleanup","5.guides/2.cleanup","i-lucide-trash-2",{"title":162,"path":163,"stem":164,"icon":165},"Troubleshooting","/guides/troubleshooting","5.guides/4.troubleshooting","i-lucide-wrench",{"title":167,"icon":168,"defaultOpen":65,"path":169,"stem":170,"children":171,"page":65},"Reference","i-lucide-file-text","/reference","6.reference",[172],{"title":173,"path":174,"stem":175,"icon":168},"API Reference Guide","/reference/api","6.reference/1.api",{"title":177,"icon":126,"defaultOpen":65,"path":178,"stem":179,"children":180,"page":65},"Benchmarks","/benchmarks","7.benchmarks",[181,186,190],{"title":182,"path":183,"stem":184,"icon":185},"Benchmark Concepts","/benchmarks/benchmark-concepts","7.benchmarks/0.benchmark-concepts","i-lucide-book-open",{"title":187,"path":188,"stem":189,"icon":126},"Benchmarking & Load Testing","/benchmarks/benchmarking-load-testing","7.benchmarks/1.benchmarking-load-testing",{"title":191,"path":192,"stem":193,"children":194,"icon":203},"Benchmark Results","/benchmarks/benchmark-results","7.benchmarks/2.benchmark-results",[195,199],{"title":196,"path":197,"stem":198,"icon":97},"Local Benchmark Comparison","/benchmarks/benchmark-results/local-benchmark-comparison","7.benchmarks/2.benchmark-results/1.local-benchmark-comparison",{"title":200,"path":201,"stem":202,"icon":26},"Redis + Hybrid Benchmark Comparison","/benchmarks/benchmark-results/redis-benchmark-comparison","7.benchmarks/2.benchmark-results/2.redis-benchmark-comparison","i-lucide-chart-no-axes-combined",{"title":205,"path":206,"stem":207,"children":208,"icon":210,"defaultOpen":65},"Changelog","/changelog","8.changelog/00.index",[209,211,216,220,224,228,232,236,240,244,248],{"title":205,"path":206,"stem":207,"icon":210},"i-lucide-scroll",{"title":212,"path":213,"stem":214,"icon":215},"v3.1.0","/changelog/v3-1-0","8.changelog/01.v3-1-0","i-lucide-tag",{"title":217,"path":218,"stem":219,"icon":215},"v3.0.0","/changelog/v3-0-0","8.changelog/02.v3-0-0",{"title":221,"path":222,"stem":223,"icon":215},"v2.3.0","/changelog/v2-3-0","8.changelog/03.v2-3-0",{"title":225,"path":226,"stem":227,"icon":215},"v2.2.1","/changelog/v2-2-1","8.changelog/04.v2-2-1",{"title":229,"path":230,"stem":231,"icon":215},"v2.2.0","/changelog/v2-2-0","8.changelog/05.v2-2-0",{"title":233,"path":234,"stem":235,"icon":215},"v2.1.0","/changelog/v2-1-0","8.changelog/06.v2-1-0",{"title":237,"path":238,"stem":239,"icon":215},"v2.0.0","/changelog/v2-0-0","8.changelog/07.v2-0-0",{"title":241,"path":242,"stem":243,"icon":215},"v1.1.0","/changelog/v1-1-0","8.changelog/08.v1-1-0",{"title":245,"path":246,"stem":247,"icon":215},"v1.0.1","/changelog/v1-0-1","8.changelog/09.v1-0-1",{"title":249,"path":250,"stem":251,"icon":215},"v1.0.0","/changelog/v1-0-0","8.changelog/10.v1-0-0",{"id":253,"title":212,"authors":254,"badge":212,"body":255,"date":254,"description":631,"extension":632,"links":254,"meta":633,"navigation":634,"path":213,"seo":635,"stem":214,"__hash__":636},"docs/8.changelog/01.v3-1-0.md",null,{"type":256,"value":257,"toc":625},"minimark",[258,266,269,274,325,531,535,585,589,598,602,605,613,621],[259,260,261,265],"p",{},[262,263,264],"strong",{},"Status:"," Released · November 15, 2026",[259,267,268],{},"Version 3.1.0 adds one getter, changes how the stale-state cleanup loops run, and fixes a memory\nleak in the hybrid limiters.",[270,271,273],"h2",{"id":272},"added","Added",[275,276,277,318],"ul",{},[278,279,280,281,285,286,289,290,293,294,297,298,301,302,301,305,289,308,301,311,293,314,317],"li",{},"Added ",[282,283,284],"code",{},"window_size(&self) -> WindowSize"," to the three providers, ",[282,287,288],{},"LocalRateLimiterProvider",",\n",[282,291,292],{},"RedisRateLimiterProvider",", and ",[282,295,296],{},"HybridRateLimiterProvider",", and to the six limiters,\n",[282,299,300],{},"AbsoluteLocalRateLimiter",", ",[282,303,304],{},"SuppressedLocalRateLimiter",[282,306,307],{},"AbsoluteRedisRateLimiter",[282,309,310],{},"SuppressedRedisRateLimiter",[282,312,313],{},"AbsoluteHybridRateLimiter",[282,315,316],{},"SuppressedHybridRateLimiter",".",[278,319,320,321,324],{},"The getter returns the builder's ",[282,322,323],{},"window_size",", or the default of 10 seconds when the builder\ndid not set one. A limiter that a provider owns returns the window of that provider.",[326,327,332],"pre",{"className":328,"code":329,"language":330,"meta":331,"style":331},"language-rust shiki shiki-themes material-theme-lighter github-light github-dark monokai","use std::sync::Arc;\nuse trypema::{RateLimiterBuilder, WindowSize};\nuse trypema::local::AbsoluteLocalRateLimiter;\n\nlet limiter: Arc\u003CAbsoluteLocalRateLimiter> = RateLimiterBuilder::local()\n    .window_size(WindowSize::seconds_or_panic(90))\n    .build()?;\n\nassert_eq!(limiter.window_size(), WindowSize::seconds_or_panic(90));\n","rust","",[282,333,334,363,388,406,412,451,479,495,500],{"__ignoreMap":331},[335,336,339,343,347,351,354,356,359],"span",{"class":337,"line":338},"line",1,[335,340,342],{"class":341},"shWJe","use",[335,344,346],{"class":345},"sKvfc"," std",[335,348,350],{"class":349},"sGXK2","::",[335,352,353],{"class":345},"sync",[335,355,350],{"class":349},[335,357,358],{"class":345},"Arc",[335,360,362],{"class":361},"swvn1",";\n",[335,364,366,368,371,373,376,379,382,385],{"class":337,"line":365},2,[335,367,342],{"class":341},[335,369,370],{"class":345}," trypema",[335,372,350],{"class":349},[335,374,375],{"class":361},"{",[335,377,378],{"class":345},"RateLimiterBuilder",[335,380,381],{"class":361},",",[335,383,384],{"class":345}," WindowSize",[335,386,387],{"class":361},"};\n",[335,389,391,393,395,397,400,402,404],{"class":337,"line":390},3,[335,392,342],{"class":341},[335,394,370],{"class":345},[335,396,350],{"class":349},[335,398,399],{"class":345},"local",[335,401,350],{"class":349},[335,403,300],{"class":345},[335,405,362],{"class":361},[335,407,409],{"class":337,"line":408},4,[335,410,411],{"emptyLinePlaceholder":33},"\n",[335,413,415,419,423,426,429,432,434,437,440,443,445,448],{"class":337,"line":414},5,[335,416,418],{"class":417},"srJo8","let",[335,420,422],{"class":421},"ss--_"," limiter",[335,424,425],{"class":349},":",[335,427,428],{"class":345}," Arc",[335,430,431],{"class":361},"\u003C",[335,433,300],{"class":345},[335,435,436],{"class":361},">",[335,438,439],{"class":349}," =",[335,441,442],{"class":345}," RateLimiterBuilder",[335,444,350],{"class":349},[335,446,399],{"class":447},"sD0ED",[335,449,450],{"class":361},"()\n",[335,452,454,457,459,462,465,467,470,472,476],{"class":337,"line":453},6,[335,455,456],{"class":349},"    .",[335,458,323],{"class":447},[335,460,461],{"class":361},"(",[335,463,464],{"class":345},"WindowSize",[335,466,350],{"class":349},[335,468,469],{"class":447},"seconds_or_panic",[335,471,461],{"class":361},[335,473,475],{"class":474},"sYThS","90",[335,477,478],{"class":361},"))\n",[335,480,482,484,487,490,493],{"class":337,"line":481},7,[335,483,456],{"class":349},[335,485,486],{"class":447},"build",[335,488,489],{"class":361},"()",[335,491,492],{"class":349},"?",[335,494,362],{"class":361},[335,496,498],{"class":337,"line":497},8,[335,499,411],{"emptyLinePlaceholder":33},[335,501,503,506,508,511,513,515,518,520,522,524,526,528],{"class":337,"line":502},9,[335,504,505],{"class":447},"assert_eq!",[335,507,461],{"class":361},[335,509,510],{"class":421},"limiter",[335,512,317],{"class":349},[335,514,323],{"class":447},[335,516,517],{"class":361},"(),",[335,519,384],{"class":345},[335,521,350],{"class":349},[335,523,469],{"class":447},[335,525,461],{"class":361},[335,527,475],{"class":474},[335,529,530],{"class":361},"));\n",[270,532,534],{"id":533},"changed","Changed",[275,536,537,548,558,566,569],{},[278,538,539,540,543,544,547],{},"A provider runs one cleanup loop for each of its two limiters, in place of one loop for both.\n",[282,541,542],{},"start_cleanup_loop()"," and ",[282,545,546],{},"stop_cleanup_loop()"," on a provider start and stop the two loops.",[278,549,550,553,554,557],{},[282,551,552],{},"provider.absolute().stop_cleanup_loop()"," stops the cleanup of the absolute strategy only, and\n",[282,555,556],{},"provider.suppressed().stop_cleanup_loop()"," stops the cleanup of the suppressed strategy only.",[278,559,560,562,563,565],{},[282,561,546],{},", or the drop of the last ",[282,564,358],{},", ends a cleanup loop at once, not at its\nnext wake up to one cleanup interval later. A pass that runs at that time completes first.",[278,567,568],{},"A failed cleanup pass of one strategy does not stop the cleanup of the other strategy, because\neach strategy has its own loop.",[278,570,571,573,574,577,578,581,582,584],{},[282,572,542],{}," on a provider takes ",[282,575,576],{},"&self",", in place of ",[282,579,580],{},"self: &Arc\u003CSelf>",". Calls on an\n",[282,583,358],{}," of a provider compile as before.",[270,586,588],{"id":587},"fixed","Fixed",[275,590,591],{},[278,592,593,594,597],{},"The hybrid limiters keep one lock for each key, so that only one call at a time reads Redis and\nupdates the local state of that key. Cleanup removed the stale state of a key but kept its lock,\nand ",[282,595,596],{},"delete"," did the same. The lock map grew with each distinct key, for example each client IP\nof a limiter keyed by IP. A cleanup pass now removes each lock that no call holds or waits on.\nThe next call to that key makes a new lock.",[270,599,601],{"id":600},"before-you-upgrade","Before you upgrade",[259,603,604],{},"No migration is necessary. Code that builds with 3.0 builds with 3.1.",[259,606,607,608,317],{},"See ",[609,610,612],"a",{"href":611},"/providers/local#build-one-strategy-directly","Build one strategy directly",[259,614,615],{},[609,616,620],{"href":617,"rel":618},"https://crates.io/crates/trypema/3.1.0",[619],"nofollow","trypema 3.1.0 on crates.io",[622,623,624],"style",{},"html pre.shiki code .shWJe, html code.shiki .shWJe{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583;--shiki-sepia:#F92672}html pre.shiki code .sKvfc, html code.shiki .sKvfc{--shiki-light:#E2931D;--shiki-light-text-decoration:inherit;--shiki-default:#6F42C1;--shiki-default-text-decoration:inherit;--shiki-dark:#B392F0;--shiki-dark-text-decoration:inherit;--shiki-sepia:#A6E22E;--shiki-sepia-text-decoration:underline}html pre.shiki code .sGXK2, html code.shiki .sGXK2{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583;--shiki-sepia:#F92672}html pre.shiki code .swvn1, html code.shiki .swvn1{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8;--shiki-sepia:#F8F8F2}html pre.shiki code .srJo8, html code.shiki .srJo8{--shiki-light:#9C3EDA;--shiki-light-font-style:inherit;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit;--shiki-sepia:#66D9EF;--shiki-sepia-font-style:italic}html pre.shiki code .ss--_, html code.shiki .ss--_{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8;--shiki-sepia:#F8F8F2}html pre.shiki code .sD0ED, html code.shiki .sD0ED{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0;--shiki-sepia:#A6E22E}html pre.shiki code .sYThS, html code.shiki .sYThS{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF;--shiki-sepia:#AE81FF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}html.sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}",{"title":331,"searchDepth":338,"depth":365,"links":626},[627,628,629,630],{"id":272,"depth":365,"text":273},{"id":533,"depth":365,"text":534},{"id":587,"depth":365,"text":588},{"id":600,"depth":365,"text":601},"Each provider and limiter returns its window from window_size(), each limiter runs its own cleanup loop, and hybrid cleanup frees the per-key locks.","md",{},{"icon":215},{"title":212,"description":631},"Y86MUQPMy0midQo26q8ZRlASY7er9la4ZIvLZ8_HNPc",[638,640],{"title":205,"path":206,"stem":207,"description":639,"icon":210,"children":-1},"Release notes for Trypema, ordered newest first.",{"title":217,"path":218,"stem":219,"description":641,"icon":215,"children":-1},"One builder struct for every provider and limiter, so an application that uses one strategy builds only that limiter.",1794796210101]