Trait ConfigurationBuilder

Source
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<S: AsRef<str>>( &mut self, switch_mappings: &[(S, S)], ) -> &mut Self

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§