A hierarchical configuration library for Rust that merges multiple sources with a concurrency-free design.
Figment is a hierarchical configuration library for Rust that allows developers to merge configuration values from multiple sources like TOML files, JSON files, and environment variables into strongly-typed Rust structs. It solves the problem of managing application configuration from diverse sources while maintaining type safety and eliminating concurrency issues.
Rust developers building applications that require configuration from multiple sources, particularly those who need type-safe configuration management without concurrency concerns.
Developers choose Figment for its concurrency-free design that eliminates race conditions, its seamless integration with serde for type-safe deserialization, and its flexible provider system that supports multiple configuration sources with clear merging semantics.
A hierarchical configuration library so con-free, it's unreal.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Combines configuration from multiple sources like TOML, JSON, and environment variables with clear precedence, as shown in the README example merging 'Cargo.toml', prefixed env vars, and 'Cargo.json'.
Uses serde for automatic deserialization into strongly-typed Rust structs, eliminating runtime errors from malformed configuration and ensuring compile-time safety.
Eliminates race conditions by design, making configuration access safe in multi-threaded environments without the need for locks or synchronization overhead.
Supports prefix-based and raw environment variable selection, allowing fine-grained control over which env vars are included, as demonstrated with 'CARGO_' prefixes and raw keys like 'RUSTC'.
Only supports TOML and JSON out-of-the-box; popular formats like YAML require third-party providers, which are scarce in the ecosystem as noted in the README.
Configuration is extracted once and becomes immutable, with no built-in support for hot-reloading or dynamic updates without re-initializing the extraction process.
Few external providers are available, limiting extensibility for niche sources or formats, as highlighted by the single listed third-party provider in the README.