ABA Cache
Simple cache written for reducing frequent access / compute expensive operation (as of now, it serves only as experimental, not intended for production yet)
This implementation is based on "LRU Cache", with another inspiration comes from "Writing a doubly linked list in Rust is easy".
Example
Basic LRU Cache
Add following dependencies to Cargo.toml
[]
= { = "0.1.0", = false }
on your main.rs
use aba_cache as cache;
Async LRU Cache
Add following dependencies to Cargo.toml
[]
= { = "0.1.0" }
= { = "0.2", = ["macros", "rt-core"] }
on your main.rs
use aba_cache as cache;
async
NB: If you have difficulty when running cargo build with error something like "failed to authenticate when downloading repository", do following:
- add these lines to ~/.gitconfig
[url "git@github.com:"]
insteadOf = https://github.com/
- add these lines to ~/.cargo/config
[net]
git-fetch-with-cli = true