cached 2.0.2

Generic cache implementations and simplified function memoization
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use cached::macros::concurrent_cached;

#[concurrent_cached(
    disk = true,
    disk_dir = "/tmp/cached-trybuild",
    size = 100,
    map_error = r#"|e| format!("{:?}", e)"#
)]
fn my_fn(k: i32) -> Result<i32, String> {
    Ok(k)
}

fn main() {}