let mut i32cache = Cache::
let mut stringcache = Cache::
let mut i32cache = AsyncCache::
let mut stringcache = AsyncCache::
[async] fetch(key, value, closure)
return cache value if not expires or recalculate closure value[async] force_fetch(key, value, closure)
force recalculate closure value[async] get(key)
return key cache value if cache existskeys()
return all cached keys including the expired cacheinsert(key, value)
overwrite cache value and expiration time if cache existsexpire(key)
make cache value expired if cache existscontains_key(key)
returns true if the cache contains an entry for the given keyremove(key)
remove cache if cache existsclear_expired()
cleanups the cache by removing expired entries.clear
empty all data include valid cache.