pub trait ConfigurationBuilder {
    // Required methods
    fn properties(&self) -> &HashMap<String, Box<dyn Any>>;
    fn sources(&self) -> &[Box<dyn ConfigurationSource>];
    fn add(&mut self, source: Box<dyn ConfigurationSource>);
    fn build(&self) -> Result<Box<dyn ConfigurationRoot>, ReloadError>;
}
Expand description

Defines the behavior used to build an application Configuration.

Required Methods§

source

fn properties(&self) -> &HashMap<String, Box<dyn Any>>

Gets a read-only key/value collection that can be used to share data between the ConfigurationBuilder and each registered ConfigurationSource.

source

fn sources(&self) -> &[Box<dyn ConfigurationSource>]

Gets the registered ConfigurationSource set used to obtain configuration values.

source

fn add(&mut self, source: Box<dyn ConfigurationSource>)

Adds a new configuration source.

Arguments
source

fn build(&self) -> Result<Box<dyn ConfigurationRoot>, ReloadError>

Builds ConfigurationRoot with the keys and values from the registered ConfigurationSource set.

Trait Implementations§

source§

impl ChainedBuilderExtensions for dyn ConfigurationBuilder

source§

fn add_configuration( &mut self, configuration: Box<dyn Configuration> ) -> &mut Self

Adds the existing configuration. Read more
source§

impl CommandLineConfigurationBuilderExtensions for dyn ConfigurationBuilder

source§

fn add_command_line(&mut self) -> &mut Self

Adds the command line configuration source.
source§

fn add_command_line_map<I, S>( &mut self, switch_mappings: &[(S, S)] ) -> &mut Self
where I: Iterator<Item = S>, S: AsRef<str>,

Adds the command line configuration source. Read more
source§

impl EnvironmentVariablesExtensions for dyn ConfigurationBuilder

source§

fn add_env_vars(&mut self) -> &mut Self

Adds environment variables as a configuration source.
source§

fn add_env_vars_with_prefix(&mut self, prefix: &str) -> &mut Self

Adds environment variables as a configuration source. Read more
source§

impl IniConfigurationExtensions for dyn ConfigurationBuilder

source§

fn add_ini_file<T: Into<FileSource>>(&mut self, file: T) -> &mut Self

Adds an *.ini file as a configuration source. Read more
source§

impl JsonConfigurationExtensions for dyn ConfigurationBuilder

source§

fn add_json_file<T: Into<FileSource>>(&mut self, file: T) -> &mut Self

Adds a *.json file as a configuration source. Read more
source§

impl MemoryConfigurationBuilderExtensions for dyn ConfigurationBuilder

source§

fn add_in_memory<S: AsRef<str>>(&mut self, data: &[(S, S)]) -> &mut Self

Adds the in-memory configuration source using the specified data. Read more
source§

impl XmlConfigurationExtensions for dyn ConfigurationBuilder

source§

fn add_xml_file<T: Into<FileSource>>(&mut self, file: T) -> &mut Self

Adds a *.xml file as a configuration source. Read more

Implementors§