Skip to main content

cache_dir

Function cache_dir 

Source
pub fn cache_dir() -> Option<PathBuf>
Expand description

Returns the path to the user’s cache directory.

The returned value depends on the operating system and is either a Some, containing a value from the following table, or a None.

PlatformValueExample
Linux$XDG_CACHE_HOME or $HOME/.cache/home/alice/.cache
macOS$HOME/Library/Caches/Users/Alice/Library/Caches
Windows%LOCALAPPDATA%C:\Users\Alice\AppData\Local

NOTE: if the feature favor-xdg-style is enabled, $HOME/.cache is favorized on macOS.