disk_large/
disk_large.rs

1use minne::Cache;
2
3fn main() -> Result<(), anyhow::Error> {
4    type K = i32;
5    type V = Vec<i32>;
6
7    let cache: Cache<K, V> = Cache::new_unbounded();
8
9    for i in 0..1E6 as i32 {
10        // Insert random f64 values into the cache
11        cache.insert(i, (0..1E3 as i32).collect());
12    }
13
14    println!("Writing cache to file...");
15    cache.write("dashing.cache")?;
16
17    let cache2: Cache<K, V> = Cache::new_unbounded();
18
19    println!("Reading cache from file...");
20    cache2.read("dashing.cache")?;
21    println!("Cache contains {} items", cache2.len());
22    Ok(())
23}