cached 3.0.0

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

// `cache_prefix_block` is redis-only; on the disk path the redb table name comes
// from `name`, so it must be rejected rather than silently ignored.
#[concurrent_cached(
    map_error = "|e| e",
    disk = true,
    cache_prefix_block = r#"{ "some_prefix" }"#
)]
fn my_fn(k: i32) -> Result<i32, String> {
    Ok(k)
}

fn main() {}