Crate conf

Crate conf 

Source
Expand description

A derive-based, highly composable env-and-argument parser aimed at the practically-minded web developer building large web projects.

To use conf, use the #[derive(Conf)] proc macro on your configuration struct. Then call a Conf trait function to parse your configuration struct. Proc macro attributes are documented there.

See README for an overview.

Structs§

ConfBuilder
A builder which collects config value sources for the parse.
ConfSerdeBuilder
A ConfBuilder which additionally has serde-document content installed.
Error
An error which occurs when a Conf::parse function is called. This may conceptually represent many underlying errors of several different types.

Traits§

Conf
The Conf trait is implemented by types that represent a collection of config parsed on startup, and is modeled on clap::Parser.
ConfSerde
Extension to Conf trait with serde-integration implementation details.
Subcommands
The Subcommands trait represents one or more subcommands that can be added to a Conf structure. To use it, put #[derive(Subcommands)] on your enum, and then add a #[conf(subcommands)] field to your Conf structure whose type is your enum type, or Option<T>.

Functions§

find_parameter
In some cases, you may want to grab a config file path from CLI args before doing the main parse, so that you can load the config file content and pass it to conf::conf_builder(), if the config file path was present.