pub fn cache(relative_path: impl AsRef<Path>) -> PathBufExpand description
Gets a path relative to the cache directory for the app.
- The cache dir can be set by
init_cachebefore any env dir is used. - In Android returns
android_internal("cache"). - In Linux, macOS and Windows if a file
config("cache-dir")is found the first non-empty and non-comment (#) line defines the res path. - In
cfg(debug_assertions)builds returnstarget/tmp/dev_cache/. - In all platforms attempts
directories::ProjectDirs::cache_dirand panic if it fails.
The cache dir is created if it is missing, checks once on init or first use.