1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
//! Resolves standard platform base directories (config, data, cache, state, executable, user
//! dirs, home) with zero dependencies.
//!
//! By default each function follows the native conventions of the host OS. Enabling the `xdg`
//! cargo feature forces XDG semantics on every platform.
//!
//! # Function families
//!
//! - Base dirs: [`config`], [`data`], [`cache`], [`state`], plus their app-scoped
//! `_for(qualifier, org, app)` variants ([`config_for`], [`data_for`], [`cache_for`],
//! [`state_for`]).
//! - User dirs: [`downloads`], [`desktop`], [`documents`], [`music`], [`pictures`], [`videos`],
//! [`templates`], [`public`], [`projects`].
//! - [`executable`] and [`home`].
//!
//! # Return types
//!
//! Functions for always-present directories return [`Result`], erroring only when `HOME` cannot
//! be resolved. Functions whose directory may legitimately be absent return [`Option`].
//!
//! # Example
//!
//! ```no_run
//! let cfg = folders::config_for("com", "example", "myapp")?;
//! # Ok::<(), folders::Error>(())
//! ```
pub
pub
pub
use PathBuf;
pub use *;
use crateUserDir;
/// If set, returns the user's home directory, resolved using the content of the $HOME environment
/// variable on UNIX-based systems, or %USERPROFILE% on windows.
/// Returns the user's platform-native configuration directory, resolving alternative paths if set through
/// standard environment variables and system settings
/// Returns the user's platform-native data directory, resolving alternative paths if set through
/// standard environment variables and system settings
/// Returns the user's platform-native cache directory, resolving alternative paths if set through
/// standard environment variables and system settings
/// Returns the user's platform-native state directory, resolving alternative paths if set through
/// standard environment variables and system settings
/// Returns the user's platform-native configuration directory with the derived application-specific
/// path suffix, resolving alternative paths if set through standard environment variables and system
/// settings. Per-platform the construction of the application-specific paths differ.
/// Returns the user's platform-native data directory with the derived application-specific
/// path suffix, resolving alternative paths if set through standard environment variables and system
/// settings. Per-platform the construction of the application-specific paths differ.
/// Returns the user's platform-native cache directory with the derived application-specific
/// path suffix, resolving alternative paths if set through standard environment variables and system
/// settings. Per-platform the construction of the application-specific paths differ.
/// Returns the user's platform-native state directory with the derived application-specific
/// path suffix, resolving alternative paths if set through standard environment variables and system
/// settings. Per-platform the construction of the application-specific paths differ.
/// Returns the user's downloads directory, or `None` when it is not defined on the platform.
/// Returns the user's desktop directory, or `None` when it is not defined on the platform.
/// Returns the user's documents directory, or `None` when it is not defined on the platform.
/// Returns the user's music directory, or `None` when it is not defined on the platform.
/// Returns the user's pictures directory, or `None` when it is not defined on the platform.
/// Returns the user's videos directory, or `None` when it is not defined on the platform.
/// Returns the user's templates directory, or `None` when it is not defined on the platform.
/// Returns the user's public share directory, or `None` when it is not defined on the platform.
/// Returns the user's projects directory, or `None` when it is not defined on the platform.
/// Returns the directory for user-specific executables, or `None` when it is not configured on
/// the platform.
/// Returns the runtime directory for the user, or `None` when it is not configured on
/// the platform.