toml_reader

Crates.iotoml_reader
lib.rstoml_reader
version0.1.1
created_at2025-06-29 08:44:10.065586+00
updated_at2025-06-29 08:47:22.063882+00
descriptionA simple library for loading TOML config files
homepage
repositoryhttps://github.com/nascar-driver/toml_reader
max_upload_size
id1730550
size7,643
the last code bender (nascar-driver)

documentation

README

toml_reader

A simple Rust library to load and access TOML configuration files with lazy static initialization.

Features

  • Deserialize TOML config into Rust structs using serde
  • Global, thread-safe, lazy initialization with once_cell
  • Easy API: initialize once, then get config anywhere

Usage

Add this to your Cargo.toml:

toml_reader = { path = "../toml_reader" }
use toml_reader::{init, get};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    init("config.toml")?;
    let config = get();
    println!("DB host: {}", config.database.host);
    Ok(())
}
Commit count: 0

cargo fmt