#toml

figment2

Remaintained fork of figment: A configuration library so con-free, it's unreal

6 releases

0.11.5 Apr 20, 2026
0.11.4 Jan 4, 2026
0.11.3 Dec 4, 2025

#150 in Configuration

Download history 1729/week @ 2026-01-19 1415/week @ 2026-01-26 2097/week @ 2026-02-02 2082/week @ 2026-02-09 1674/week @ 2026-02-16 2454/week @ 2026-02-23 3140/week @ 2026-03-02 3126/week @ 2026-03-09 2954/week @ 2026-03-16 3116/week @ 2026-03-23 3577/week @ 2026-03-30 2895/week @ 2026-04-06 2685/week @ 2026-04-13 4404/week @ 2026-04-20 5662/week @ 2026-04-27 5319/week @ 2026-05-04

18,356 downloads per month
Used in 2 crates

MIT/Apache

330KB
4.5K SLoC

figment2   ci.svg crates.io docs.rs

Remaintained fork of figment

Figment2 is a semi-hierarchical configuration library for Rust so con-free, it's unreal.

use serde::Deserialize;

use figment2::{Figment, providers::{Format, Toml, Json, Env}};

#[derive(Deserialize)]
struct Package {
    name: String,
    authors: Vec<String>,
    publish: Option<bool>,
    // ... and so on ...
}

#[derive(Deserialize)]
struct Config {
    package: Package,
    rustc: Option<String>,
    // ... and so on ...
}

let config: Config = Figment::new()
    .merge(Toml::file("Cargo.toml"))
    .merge(Env::prefixed("CARGO_"))
    .merge(Env::raw().only(&["RUSTC", "RUSTDOC"]))
    .join(Json::file("Cargo.json"))
    .extract()?;

See the documentation for a detailed usage guide and information.

Usage

Add the following to your Cargo.toml, enabling the desired built-in providers:

[dependencies]
figment2 = { version = "0.11", features = ["toml"] }

License

Figment is licensed under either of the following, at your option:

Dependencies

~0.1–6MB
~135K SLoC