#partial #configuration #error #file #serde #layered #source

bin+lib partial_config

A Rust crate to implement layered partial configuration

11 releases (5 breaking)

0.6.1 Apr 26, 2024
0.6.0 Apr 26, 2024
0.5.12 Mar 25, 2024
0.4.1 Mar 21, 2024
0.1.0 Mar 20, 2024

#19 in #layered

Download history 43/week @ 2024-03-14 643/week @ 2024-03-21 92/week @ 2024-03-28 50/week @ 2024-04-04 28/week @ 2024-04-11 77/week @ 2024-04-18 365/week @ 2024-04-25

534 downloads per month

Apache-2.0

12KB
229 lines

Partial Config

This is a WIP crate for providing a generic interface to configure one's application.

It is typical to see a configuration be composed from multiple sources: the command line, the environment variables, a config file, sometimes even through a web server.

This crate provides a generic way to do so.

Specifically, it provides

  • Two traits Partial and Source
  • A derive macro Partial that generates a new structure
  • An implementation for Source if your configuration also is serde::de::DeserializeOwned
  • Logic to combine multiple configuration sources
  • Derive macro to produce detailed error reports
  • Support for logging overlapping or overriding specifications

Dependencies

~0.1–1MB
~20K SLoC