0.1.0 |
|
---|---|
0.0.3 |
|
0.0.2 |
|
0.0.1 |
|
#224 in #asynchronous
13KB
202 lines
rusticache
Cache library to be used in async or singlethreaded(not implemented) context.
Simple usage:
use std::sync::Arc;
use rusticache::AsyncCache;
use std::time::Duration;
async fn do_stuff() {
let cache = Arc::new(AsyncCache::new(
Duration::from_secs(10),
Box::new(|| Ok(String::from("This is Sparta!")))
));
let data = cache.get_data().await;
assert_eq!(*data.unwrap(), String::from("This is Sparta!"));
}
do_stuff();
lib.rs
:
DOCUMENTATION NOT FINISHED
Dependencies
~2–7.5MB
~47K SLoC