Registry / config / figment

figment

JSON →
library0.10.19rscratesunverified

A configuration library for Rust that supports merging multiple sources like files, environment variables, and CLI arguments.

# Cargo.toml [dependencies] figment = "0.10.19"
INSTALL
IMPORT
SIG · FIGMENT
F
figment
configrustv0.10.19
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Figment
use figment::Figment;

Loads configuration from a TOML file and environment variables, merging them into a struct.

use figment::Figment; use figment::providers::{Format, Toml, Env}; let config: MyConfig = Figment::new() .merge(Toml::file("config.toml")) .merge(Env::prefixed("APP_")) .extract()?;
Debug
Known issues
gotchaExtract requires the 'serde' feature and derive Deserialize on your config struct.
fix
Add serde = { version = "1", features = ["derive"] } to Cargo.toml and #[derive(Deserialize)] to your struct.
affects: >=0.10.0
Upgrade
Version history
0.10.19latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
30 hits · last 30 days
node
28
Resources
figment — cargo add figment · libregistry