Function xdirs::data_dir_for [−][src]
pub fn data_dir_for(app: &str) -> Option<PathBuf>
Returns the path to the user’s data 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_DATA_HOME or $HOME /.local/share/{app} | /home/alice/.local/share/MyApp |
macOS | $HOME /Library/Application Support/{app} | /Users/Alice/Library/Application Support/MyApp |
Windows | {FOLDERID_RoamingAppData} /{app} | C:\Users\Alice\AppData\Roaming\MyApp |
See also data_dir
.