Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rust
  3. Figment

Figment

Apache-2.0Rust

A hierarchical configuration library for Rust that merges multiple sources with a concurrency-free design.

GitHubGitHub
912 stars51 forks0 contributors

What is Figment?

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.

Target Audience

Rust developers building applications that require configuration from multiple sources, particularly those who need type-safe configuration management without concurrency concerns.

Value Proposition

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.

Overview

A hierarchical configuration library so con-free, it's unreal.

Use Cases

Best For

  • Managing application configuration from multiple file formats in Rust
  • Type-safe configuration extraction in Rust applications
  • Eliminating concurrency issues in configuration access
  • Merging environment variables with file-based configuration
  • Building Rust applications with complex configuration requirements
  • Creating extensible configuration systems with custom providers

Not Ideal For

  • Projects requiring dynamic, hot-reloadable configuration without application restarts
  • Applications using YAML or other unsupported formats without custom provider implementation
  • Simple Rust apps with single-file configuration where plain serde deserialization is sufficient

Pros & Cons

Pros

Hierarchical Merging

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'.

Type-Safe Extraction

Uses serde for automatic deserialization into strongly-typed Rust structs, eliminating runtime errors from malformed configuration and ensuring compile-time safety.

Concurrency-Free Design

Eliminates race conditions by design, making configuration access safe in multi-threaded environments without the need for locks or synchronization overhead.

Flexible Environment Integration

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'.

Cons

Limited Built-in Formats

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.

Static Extraction Model

Configuration is extracted once and becomes immutable, with no built-in support for hot-reloading or dynamic updates without re-initializing the extraction process.

Sparse Third-Party Ecosystem

Few external providers are available, limiting extensibility for niche sources or formats, as highlighted by the single listed third-party provider in the README.

Frequently Asked Questions

Quick Stats

Stars912
Forks51
Contributors0
Open Issues21
Last commit2 years ago
CreatedSince 2020

Tags

#environment-variables#serde#library#configuration#type-safe#json#rust#toml

Built With

s
serde
R
Rust

Included in

Rust56.6k
Auto-fetched 10 hours ago

Related Projects

config-rsconfig-rs

⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).

Stars3,207
Forks265
Last commit5 days ago
envyenvy

deserialize env vars into typesafe structs with rust

Stars980
Forks46
Last commit2 years ago
configure_meconfigure_me

A Rust library for processing application configuration easily

Stars70
Forks18
Last commit2 years ago
cfg-rscfg-rs

A Configuration Library for Rust Applications

Stars55
Forks7
Last commit1 month ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub