count_cache 0.1.1

Counted cache system
Documentation
  • Coverage
  • 0%
    0 out of 7 items documented0 out of 6 items with examples
  • Size
  • Source code size: 3.59 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.32 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Documentation
  • czotti/count-cache-rs
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • czotti

Count Cache

Latest Version Build Status Deps

This create provide a simple way to use a counted cache system. When the count drop to zero, the cache delete the associated key, and the elements cannot be accessed anymore.

Here is an exemple:

use count_cache::CountCache;

fn main() {
    let ccache = CountCache::new();

    ccache.insert("test", 10.256, 2);
    assert_eq!(ccache.get(&"test").expect("Err"), 10.256);
    assert_eq!(ccache.get(&"test").expect("Err"), 10.256);
    assert!(ccache.get(&"test").is_err());
    assert!(ccache.get(&"test").is_err());
}