#cache #async

r-cache

r-cache is an in memory key value store. It is thread safe and values have expiry times

12 releases

0.4.3 Aug 14, 2021
0.4.2 Aug 9, 2021
0.4.1 Jun 7, 2021
0.4.0 Jan 11, 2021
0.1.0 Sep 19, 2020

#24 in Caching

Download history 521/week @ 2021-06-01 403/week @ 2021-06-08 517/week @ 2021-06-15 565/week @ 2021-06-22 224/week @ 2021-06-29 428/week @ 2021-07-06 398/week @ 2021-07-13 491/week @ 2021-07-20 546/week @ 2021-07-27 536/week @ 2021-08-03 628/week @ 2021-08-10 521/week @ 2021-08-17 1034/week @ 2021-08-24 1442/week @ 2021-08-31 3129/week @ 2021-09-07 5639/week @ 2021-09-14

2,030 downloads per month

MIT/Apache

10KB
205 lines

r-cache

A simple caching library


r-cache is an in memory key value store. It is thread safe and values can have expiry times.

Example

use r_cache::cache::Cache;
use std::time::Duration;

const KEY: i8 = 0;
const VALUE: &str = "VALUE";

#[async_std::main]
async fn main() {
   let cache = Cache::new(Some(Duration::from_secs(2 * 60 * 60)));
   cache.set(KEY, VALUE, None).await;

   println!("{}", cache.get(&KEY).await.unwrap())
}

Dependencies

~81KB