ronf

Crates.ioronf
lib.rsronf
version0.4.2
created_at2025-04-04 11:54:58.431827+00
updated_at2025-04-24 16:14:32.239279+00
descriptionConfiguration system with saving
homepagehttps://github.com/LeviLovie/ronf
repositoryhttps://github.com/LeviLovie/ronf
max_upload_size
id1619857
size135,471
LeviLovie (LeviLovie)

documentation

README

Rust Docs Coverage Crates License

Ronf

A configuration library with saving based on config-rs.

Examples

use ronf::prelude::{Config, File, FileFormat};

fn main() {
    let config = Config::builder()
        .add(File::new_str(
            "test_file",
            FileFormat::Json,
            "{\"key\": \"value\"}",
        ))
        .build()
        .unwrap();
    println!("\"key\": {}", config.get("key").unwrap());
}

For more examples, check examples/. Run with cargo run --example FILE_NAME.

Features

  • ordered - Uses HashMap from indexmap instead of std::collections to preserve order of arrays;
  • load_after_build - Enables loading saves on Config (After building with ConfigBuilder::build());
  • read_file - Add functions to read File from path;
  • env - Adds .env() on ConfigBuilder to overwrite keys with env vars.

File formats

Commit count: 67

cargo fmt