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
let cfg = folders::config_for("com", "example", "myapp")?;
# Ok::<(), folders::Error>(())