Function dirs::state_dir

source ·
pub fn state_dir() -> Option<PathBuf>
Expand description

Returns the path to the user’s state directory.

The state directory contains data that should be retained between sessions (unlike the runtime directory), but may not be important/portable enough to be synchronized across machines (unlike the config/preferences/data directories).

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_STATE_HOME or $HOME/.local/state/home/alice/.local/state
macOS
Windows