config-better

Crates.ioconfig-better
lib.rsconfig-better
version1.2.0
sourcesrc
created_at2021-09-20 20:45:23.444562
updated_at2023-11-16 00:51:45.341042
descriptionConfigure your application in a friendlier and more consistent way!
homepagehttps://github.com/kade-robertson/config-better-rs
repositoryhttps://github.com/kade-robertson/config-better-rs
max_upload_size
id454139
size25,873
Kade (kade-robertson)

documentation

README

config-better-rs

Make use of directories for configuration / data / caching better and more user-friendly!

This module provides support for the XDG Base Directory specification, and OS-friendly fallbacks for Windows, Mac OS, and Linux if not otherwise specified.

This is a port of the Python version of the same name.

Usage

use config_better::Config;

fn main() {
    let dirs = Config::new("some-app");
    println!("{:?}", dirs);

    // View paths
    println!("{:?}", dirs.cache);
    println!("{:?}", dirs.config);
    println!("{:?}", dirs.data);

    // Create/delete a single directory
    dirs.cache.create();
    dirs.cache.remove();

    // Create/delete all directories
    dirs.create_all();
    dirs.remove_all();
}

Any directory create and remove methods can have an async counterpart provided by the async feature.

For further details, refer to installation instructions on crates.io and docs on docs.rs.

MSRV

For the sync and async features of the crate, the MSRV is 1.61.0. For the async-tokio feature of the crate, the MSRV is 1.63.0.

Commit count: 28

cargo fmt