A layered configuration system for Rust applications with strong support for 12-factor applications.
config-rs is a Rust library that provides a layered configuration system for applications, allowing settings to be loaded from multiple sources like files, environment variables, and programmatic overrides. It solves the problem of managing application configuration in a flexible, environment-aware way, particularly for 12-factor applications.
Rust developers building applications that require externalized, multi-source configuration management, especially those following 12-factor principles or working on cloud-native projects.
Developers choose config-rs for its strong support of 12-factor applications, extensive file format compatibility, and loose typing that simplifies configuration access without rigid type constraints.
⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).
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 defaults, file settings, environment variables, and programmatic overrides into a unified hierarchy, adhering to 12-factor principles for environment-aware apps.
Supports reading from JSON, TOML, YAML, INI, RON, JSON5, and Corn files via feature flags, allowing diverse configuration sources without lock-in.
Uses JSONPath-like syntax with child and subscript operators (e.g., `redis.port` or `databases[0].name`) to simplify accessing complex configuration structures.
Provides a `Format` trait for integrating custom or proprietary data formats, as shown in the repository's examples, ensuring adaptability to niche use cases.
Explicitly stated in the README that it cannot save changed values back to files, limiting dynamic configuration management in applications needing persistence.
Loosely typed access relies on runtime conversions, which can fail silently or cause errors if configuration types are mismatched or improperly defined.
Each file format requires enabling specific feature flags, complicating dependency management and potentially bloating binaries if all formats are included unnecessarily.