-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for layered config using a serde Deserializer as a source
This allows a serde Deserializer, representing a config file, to be used as a value source, via the builder API, which is also new in this commit. To use the serde feature, you have to put the `#[conf(serde)]` tag on your struct. We also introduce a `ConfSerde` extension trait, which is implemented when `#[conf(serde)]` is annotated, and provides implementation details for this layered config feature on that struct. The priority order is args > env > serde > defaults We also support this in subcommands, via the `SubcommandsSerde` extension trait. To further adjust the serde system, most fields have serde options like `serde(rename)` and `serde(skip)`. Structs have a `serde(allow_unknown_fields)` option. Parameter and Repeat fields have a `serde(use_value_parser)` option, which can be useful if you just want serde to read a string and then forward it to the value parser.
- Loading branch information
Showing
37 changed files
with
4,701 additions
and
786 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.