Trait config_manager::ConfigInit
source · pub trait ConfigInit {
fn parse_options(options: ConfigOptions) -> Result<Self, Error>
where
Self: Sized;
fn get_command() -> Command;
fn parse() -> Result<Self, Error>
where
Self: Sized,
{ ... }
}Expand description
Config trait that constructs an instance of itself from environment, command line and configuration files.
Don’t implement the trait manually,
invoking #[config] is the only correct way to derive this trait.
Required Methods§
sourcefn parse_options(options: ConfigOptions) -> Result<Self, Error>where
Self: Sized,
fn parse_options(options: ConfigOptions) -> Result<Self, Error>where
Self: Sized,
Takes all the environment and tries to build an instance according to the options and the structure attributes.
sourcefn get_command() -> Command
fn get_command() -> Command
Build clap::Command that can initialize the annotated struct.