Function xdirs::cache_dir_for [−][src]
pub fn cache_dir_for(app: &str) -> Option<PathBuf>
Returns the path to the user’s cache directory for a specific application.
The returned value depends on the operating system and is either a Some
, containing a value
from the following table, or a None
.
Platform | Value | Example |
---|---|---|
Linux | $XDG_CACHE_HOME or $HOME /.cache/{app} | /home/alice/.cache/MyApp |
macOS | $HOME /Library/Caches/{app} | /Users/Alice/Library/Caches/MyApp |
Windows | {FOLDERID_LocalAppData} /{app} | C:\Users\Alice\AppData\Local\MyApp |
See also cache_dir
.