Crate xdg[stability] [-] [+] [src]

xdg-rs is a utility library to make conforming to the XDG basedir specification easier.

Example

#![cfg(unix)]
extern crate xdg;

#![cfg(unix)]
use xdg;
use std::path::PathBuf;
...
let data_home: PathBuf = try!(xdg::get_data_home());
...

Alternate implementation and some initial source borrowed from rust-xdg. The APIs provided by rust-xdg and xdg-rs are different.

Reexports

pub use error::*;

Modules

error

Functions

get_cache_home

Get the cache home directory.

get_cache_home_from_env

Get the cache home directory given a closure that returns the the value of an environment variable. This method allows having a custom environment.

get_config_dirs

Get the config directories.

get_config_dirs_from_env

Get the default config directories given a closure that returns the the value of an environment variable. This method allows having a custom environment.

get_config_home

Get the config home directory.

get_config_home_from_env

Get the config home directory given a closure that returns the the value of an environment variable. This method allows having a custom environment.

get_data_dirs

Get the data directories.

get_data_dirs_from_env

Get the default data directories given a closure that returns the the value of an environment variable. This method allows having a custom environment.

get_data_home

Get the data home directory.

get_data_home_from_env

Get the data home directory given a closure that returns the the value of an environment variable. This method allows having a custom environment.

get_runtime_dir

Get $XDG_RUNTIME_DIR if found in the environment.

get_runtime_dir_from_env

Get $XDG_RUNTIME_DIR if found in the environment. This method allows having a custom environment.