[
][Github-url]
[
][CI-url]
[
][codecov-url]
[
][doc-url]
[
][crates-url]
[
][license-apache-url]
[
][license-mit-url]
This is a Rust implementation for popular caches (support no_std).
See [Introduction](#introduction), [Installation](#installation) and [Usages](#usages) for more details.
[English](README.md) | 简体中文
## Introduction
The MSRV for this crate is 1.55.0.
- LRU
- `LRUCache`, `SegmentedCache`, `TwoQueueCache` and `AdaptiveCache`.
- LFU
- `TinyLFU`, `SampledLFU`, and `WTinyLFUCache`
## Installation
- std
```toml
[dependencies]
caches = "0.2"
```
- no_std
```toml
[dependencies]
caches = { version: "0.2", default-features = false }
```
## Usages
Please see [`examples`].
## Acknowledgments
- The implementation of `RawLRU` is highly inspired by
[Jerome Froelich's LRU implementation](https://github.com/jeromefroe/lru-rs)
and [`std::collections`] library of Rust.
- Thanks for [HashiCorp's golang-lru](https://github.com/hashicorp/golang-lru)
providing the amazing Go implementation.
- Ramakrishna's paper: [Caching strategies to improve disk system performance]
- The implementation of TinyLFU and SampledLFU are inspired by [Dgraph's ristretto] and dgryski's [go-tinylfu].
- Gil Einziger's paper: [TinyLFU: A Highly Efficient Cache Admission Policy]
## Roadmap
- [x] `0.2`: Support TinyLFU, SampledLFU, WTinyLFUCache
- [ ] `0.3`: Support LIRS, DLIRS, DSLRU
- [ ] `0.4`: Add ttl feature to support
#### License