Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork40
A high-performance, concurrent, content-addressable disk cache, with support for both sync and async APIs. 💩💵 but for your 🦀
License
zkat/cacache-rs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A high-performance, concurrent, content-addressable disk cache, optimized for async APIs.
use cacache;use async_attributes;#[async_attributes::main]asyncfnmain() ->Result<(), cacache::Error>{let dir =String::from("./my-cache");// Write some data! cacache::write(&dir,"key",b"my-async-data").await?;// Get the data back!let data = cacache::read(&dir,"key").await?;assert_eq!(data,b"my-async-data");// Clean up the data! cacache::rm::all(&dir).await?;}
Usingcargo-edit
$ cargo add cacache
Minimum supported Rust version is1.43.0
.
- First-class async support, using either
async-std
ortokio
as its runtime. Sync APIs areavailable but secondary. You can also use sync APIs only and remove theasync runtime dependency. std::fs
-style API- Extraction by key or by content address (shasum, etc)
- Subresource Integrity web standard support
- Multi-hash support - safely host sha1, sha512, etc, in a single cache
- Automatic content deduplication
- Atomic content writes even for large data
- Fault tolerance (immune to corruption, partial writes, process races, etc)
- Consistency guarantees on read and write (full data verification)
- Lockless, high-concurrency cache access
- Really helpful, contextual error messages
- Large file support
- Pretty darn fast
- Arbitrary metadata storage
- Cross-platform: Windows and case-(in)sensitive filesystem support
miette
integration for detailed, helpful error reporting.- Punches nazis
async-std
is the default async runtime. To usetokio
instead, turn offdefault features and enable thetokio-runtime
feature, like this:
[dependencies]cacache = {version ="*",default-features =false,features = ["tokio-runtime","mmap"] }
You can also remove async APIs altogether, including removing async runtimedependency:
[dependencies]cacache = {version ="*",default-features =false,features = ["mmap"] }
Experimental support for symlinking to existing files is provided via the"link_to" feature.
The cacache team enthusiastically welcomes contributions and projectparticipation! There's a bunch of things you can do if you want to contribute!TheContributor Guide has all the information you need foreverything from reporting bugs to contributing entire new features. Pleasedon't hesitate to jump in if you'd like to, or even ask us questions ifsomething isn't clear.
All participants and maintainers in this project are expected to followCodeof Conduct, and just generally be excellent to eachother.
Happy hacking!
The Minimum Supported Rust Version for cacache is1.67.0
. Any changes to theMSRV will be considered breaking changes.
This project is licensed underthe Apache-2.0 License.
About
A high-performance, concurrent, content-addressable disk cache, with support for both sync and async APIs. 💩💵 but for your 🦀
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.