Skip to main content

cache_dir

Function cache_dir 

Source
pub fn cache_dir(app: &str) -> Option<PathBuf>
Expand description

Where application app keeps its cache: files it can rebuild at any time, which the user or the system may delete without losing anything.

  • Linux and other Unix systems: $XDG_CACHE_HOME/<app> when XDG_CACHE_HOME is an absolute path, else $HOME/.cache/<app>.
  • macOS: $HOME/Library/Caches/<app>.
  • Windows: %LOCALAPPDATA%\<app>, the local folder, so a cache is never copied between machines by a roaming profile.

None when the platform’s variables say nothing, and when HOME is not an absolute path. The folder is not created and does not have to exist.