Expand description
The user’s directories, resolved in one place (sandboxed in tests). The user’s directories, resolved in one place.
Every file scope keeps for the user (config, address book, token
aliases, session, journal, venues) is found through these functions.
Code calls them instead of dirs::* (clippy’s disallowed-methods
enforces this).
In test builds (cfg(test) or the test-support feature, which every
test crate turns on) they resolve under a sandbox directory for each
process, never the real home. Tests that wrote the real directories
replaced a user’s API keys, address book and token aliases with test
data.
Constants§
- TEST_
HOME_ VAR - In test builds, the environment variable that moves the sandbox, for a test that needs a home it controls (for example one that cannot be written).
Functions§
- config_
dir - The platform’s config directory (for example
~/Library/Application Supporton macOS). - data_
dir - The platform’s data directory (for example
~/Library/Application Supporton macOS). - home_
dir - The home directory.