count_cache

Crates.iocount_cache
lib.rscount_cache
version0.1.1
sourcesrc
created_at2019-03-23 12:03:14.010113
updated_at2019-03-23 17:44:31.361024
descriptionCounted cache system
homepage
repositoryhttps://github.com/czotti/count-cache-rs
max_upload_size
id123280
size3,961
Clément ZOTTI (czotti)

documentation

https://github.com/czotti/count-cache-rs

README

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());
}
Commit count: 7

cargo fmt