#lru-cache #cache #lru #tinylfu

no-std caches

This is a Rust implementation for popular caches (support no_std)

12 releases

0.2.8 Dec 2, 2023
0.2.7 Oct 31, 2023
0.2.4 Jun 19, 2023
0.2.3 Nov 12, 2022
0.1.8 Sep 23, 2021

#148 in Data structures

Download history 482/week @ 2024-08-10 685/week @ 2024-08-17 579/week @ 2024-08-24 686/week @ 2024-08-31 306/week @ 2024-09-07 434/week @ 2024-09-14 599/week @ 2024-09-21 565/week @ 2024-09-28 1560/week @ 2024-10-05 1080/week @ 2024-10-12 1057/week @ 2024-10-19 679/week @ 2024-10-26 1142/week @ 2024-11-02 737/week @ 2024-11-09 741/week @ 2024-11-16 647/week @ 2024-11-23

3,350 downloads per month
Used in rusvm

MIT/Apache

350KB
5.5K SLoC

Caches

github Build codecov

docs.rs crates.io crates.io

license

This is a Rust implementation for popular caches (support no_std).

See Introduction, Installation and Usages for more details.

English | 简体中文

Introduction

The MSRV for this crate is 1.55.0.

  • LRU
    • LRUCache, SegmentedCache, TwoQueueCache and AdaptiveCache.
  • LFU
    • TinyLFU, SampledLFU, and WTinyLFUCache

Installation

  • std
    [dependencies]
    caches = "0.2" 
    
  • no_std
    [dependencies]
    caches = {version: "0.2", default-features = false }
    

Usages

Please see examples.

Roadmap

  • 0.2: Support TinyLFU, SampledLFU, WTinyLFUCache
  • 0.3: Support LIRS, DLIRS, DSLRU
  • 0.4: Add ttl feature

If you want a high-performance thread-safe modern cache, please see https://crates.io/crates/stretto

Acknowledgments

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.9–1.7MB
~35K SLoC