Module cache
Source - Cache
- Cache struct to manage cache operations
- clear_cache
- Clears the entire application cache directory.
- get_cache_dir
- Gets the path to the application’s cache directory, creating it if necessary.
Uses dirs::cache_dir() to find the appropriate system cache location.
- is_cache_valid
- Checks if a specific cache file exists and is valid (within TTL).
- load_from_cache
- Loads and deserializes data from a file in the cache directory.
Checks if the cache file exists and is within the TTL (Time To Live).
- save_to_cache
- Saves serializable data to a file in the cache directory.
The data is serialized as JSON.