[{"data":1,"prerenderedAt":316},["ShallowReactive",2],{"navigation":3,"\u002Fgetting-started":151,"\u002Fgetting-started-surround":313},[4,29,56,79,94,121,128,144],{"title":5,"path":6,"stem":7,"children":8,"icon":27,"defaultOpen":28},"Getting Started","\u002Fgetting-started","1.getting-started\u002F1.index",[9,12,17,22],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-book-open",{"title":13,"path":14,"stem":15,"icon":16},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":18,"path":19,"stem":20,"icon":21},"Redis setup","\u002Fgetting-started\u002Fredis-setup","1.getting-started\u002F3.redis-setup","i-lucide-database",{"title":23,"path":24,"stem":25,"icon":26},"Quickstart","\u002Fgetting-started\u002Fquickstart","1.getting-started\u002F4.quickstart","i-lucide-zap","i-lucide-rocket",true,{"title":30,"icon":31,"path":32,"stem":33,"children":34,"page":55},"Concepts","i-lucide-lightbulb","\u002Fconcepts","2.concepts",[35,40,45,50],{"title":36,"path":37,"stem":38,"icon":39},"Keys","\u002Fconcepts\u002Fkeys","2.concepts\u002F1.keys","i-lucide-key-round",{"title":41,"path":42,"stem":43,"icon":44},"Strict vs lax","\u002Fconcepts\u002Fstrict-vs-lax","2.concepts\u002F2.strict-vs-lax","i-lucide-scale",{"title":46,"path":47,"stem":48,"icon":49},"Comparators","\u002Fconcepts\u002Fcomparators","2.concepts\u002F3.comparators","i-lucide-git-compare",{"title":51,"path":52,"stem":53,"icon":54},"Errors","\u002Fconcepts\u002Ferrors","2.concepts\u002F4.errors","i-lucide-triangle-alert",false,{"title":57,"path":58,"stem":59,"children":60,"icon":63},"Counters","\u002Fcounters","3.counters\u002F1.index",[61,64,69,74],{"title":62,"path":58,"stem":59,"icon":63},"Overview","i-lucide-hash",{"title":65,"path":66,"stem":67,"icon":68},"StrictCounter","\u002Fcounters\u002Fstrict-counter","3.counters\u002F2.strict-counter","i-lucide-target",{"title":70,"path":71,"stem":72,"icon":73},"LaxCounter","\u002Fcounters\u002Flax-counter","3.counters\u002F3.lax-counter","i-lucide-wind",{"title":75,"path":76,"stem":77,"icon":78},"Conditional & batch operations","\u002Fcounters\u002Fconditional-and-batch","3.counters\u002F4.conditional-and-batch","i-lucide-layers",{"title":80,"path":81,"stem":82,"children":83,"icon":85},"Instance-aware counters","\u002Finstance-aware-counters","4.instance-aware-counters\u002F1.index",[84,86,90],{"title":62,"path":81,"stem":82,"icon":85},"i-lucide-network",{"title":87,"path":88,"stem":89,"icon":68},"StrictInstanceAwareCounter","\u002Finstance-aware-counters\u002Fstrict","4.instance-aware-counters\u002F2.strict",{"title":91,"path":92,"stem":93,"icon":73},"LaxInstanceAwareCounter","\u002Finstance-aware-counters\u002Flax","4.instance-aware-counters\u002F3.lax",{"title":95,"path":96,"stem":97,"children":98,"icon":100},"Locks","\u002Flocks","5.locks\u002F1.index",[99,101,106,111,116],{"title":62,"path":96,"stem":97,"icon":100},"i-lucide-lock",{"title":102,"path":103,"stem":104,"icon":105},"Mutex","\u002Flocks\u002Fmutex","5.locks\u002F2.mutex","i-lucide-lock-keyhole",{"title":107,"path":108,"stem":109,"icon":110},"RwLock","\u002Flocks\u002Frwlock","5.locks\u002F3.rwlock","i-lucide-book-lock",{"title":112,"path":113,"stem":114,"icon":115},"Lock options","\u002Flocks\u002Foptions","5.locks\u002F4.options","i-lucide-sliders-horizontal",{"title":117,"path":118,"stem":119,"icon":120},"Guard state & errors","\u002Flocks\u002Fguard-state","5.locks\u002F5.guard-state","i-lucide-shield-alert",{"title":122,"path":123,"stem":124,"children":125,"icon":127},"Rate limiting","\u002Frate-limiting","6.rate-limiting\u002F1.index",[126],{"title":122,"path":123,"stem":124,"icon":127},"i-lucide-gauge",{"title":129,"icon":130,"path":131,"stem":132,"children":133,"page":55},"Reference","i-lucide-book-marked","\u002Freference","7.reference",[134,139],{"title":135,"path":136,"stem":137,"icon":138},"Feature flags","\u002Freference\u002Ffeature-flags","7.reference\u002F1.feature-flags","i-lucide-flag",{"title":140,"path":141,"stem":142,"icon":143},"API reference","\u002Freference\u002Fapi","7.reference\u002F2.api","i-lucide-file-code",{"title":145,"path":146,"stem":147,"children":148,"icon":150},"Changelog","\u002Fchangelog","8.changelog\u002F1.index",[149],{"title":145,"path":146,"stem":147,"icon":150},"i-lucide-scroll",{"id":152,"title":10,"badge":153,"body":154,"date":153,"description":307,"extension":308,"links":153,"meta":309,"navigation":310,"path":6,"seo":311,"stem":7,"__hash__":312},"docs\u002F1.getting-started\u002F1.index.md",null,{"type":155,"value":156,"toc":299},"minimark",[157,161,209,218,223,226,263,267,278,282],[158,159,160],"p",{},"distkit is a toolkit of distributed systems primitives for Rust, backed by Redis. It bundles the pieces async services keep rebuilding by hand:",[162,163,164,171,176,193],"ul",{},[165,166,167,170],"li",{},[168,169,57],"strong",{}," - distributed integer counters in strict (immediately consistent) and lax (buffered) flavors.",[165,172,173,175],{},[168,174,80],{}," - counters where each instance owns a slice of the total, with automatic cleanup when an instance dies.",[165,177,178,181,182,185,186,188,189,192],{},[168,179,180],{},"Distributed locks"," - a ",[183,184,102],"code",{}," and a writer-preferring ",[183,187,107],{}," that mirror ",[183,190,191],{},"tokio::sync",".",[165,194,195,197,198,205,206,192],{},[168,196,122],{}," - sliding-window rate limiting via the ",[199,200,204],"a",{"href":201,"rel":202},"https:\u002F\u002Fdocs.rs\u002Ftrypema",[203],"nofollow","trypema"," crate, re-exported under ",[183,207,208],{},"distkit::trypema",[158,210,211,212,217],{},"Everything is async and built for ",[199,213,216],{"href":214,"rel":215},"https:\u002F\u002Ftokio.rs",[203],"Tokio",". Strict operations push their logic into Redis as Lua scripts, so a single round-trip is atomic across every instance sharing the same Redis.",[219,220,222],"h2",{"id":221},"guarantees","Guarantees",[158,224,225],{},"distkit aims to be boring in the best way:",[162,227,228,237,253],{},[165,229,230,233,234,192],{},[168,231,232],{},"No unsafe."," The crate is ",[183,235,236],{},"#![forbid(unsafe_code)]",[165,238,239,242,243,248,249,252],{},[168,240,241],{},"No panics in library code."," Failures come back as a ",[199,244,245],{"href":52},[183,246,247],{},"DistkitError",", never an ",[183,250,251],{},"unwrap"," in your hot path.",[165,254,255,258,259,262],{},[168,256,257],{},"Predictable background work."," The tasks that flush buffers and renew lock leases hold ",[183,260,261],{},"Weak"," references, so they shut down on their own when the owning value is dropped.",[219,264,266],{"id":265},"what-you-need","What you need",[162,268,269,272,275],{},[165,270,271],{},"Rust (latest stable; the crate uses edition 2024).",[165,273,274],{},"A reachable Redis instance, 5.0 or newer (Lua scripting is required).",[165,276,277],{},"The Tokio runtime.",[219,279,281],{"id":280},"where-to-go-next","Where to go next",[162,283,284,289,294],{},[165,285,286,288],{},[199,287,13],{"href":14}," - pick the right feature set.",[165,290,291,293],{},[199,292,18],{"href":19}," - build a connection your primitives can share.",[165,295,296,298],{},[199,297,23],{"href":24}," - a counter running end to end.",{"title":300,"searchDepth":301,"depth":302,"links":303},"",1,2,[304,305,306],{"id":221,"depth":302,"text":222},{"id":265,"depth":302,"text":266},{"id":280,"depth":302,"text":281},"What distkit is, what it gives you, and the guarantees it makes.","md",{},{"icon":11},{"title":10,"description":307},"6AFg088SYkfy6Mev_dRM6CnOyshDFhN_in88zjuslhQ",[153,314],{"title":13,"path":14,"stem":15,"description":315,"icon":16,"children":-1},"Add distkit and turn on only the primitives you need with feature flags.",1781569581680]