cachecow
A stupid simple JSON key-value filesystem cache.
Usage
Create a cache instance:
let mut cache = new?;
Use FlushPolicy::Manual to avoid writing to the filesystem on every update. You must then call Cache::flush() manually to preserve updated cache contents.
Set entries in the cache:
cache.set?;
Values can be any JSON serializable value.
Retrieve entries from the cache:
cache.; // Some("world")
Retrieve an entry from the cache, or set and return a default value in case of a miss:
cache.get_or?; // 123
Empty the cache:
cache.clear;