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§
Sourcefn properties(&self) -> &HashMap<String, Box<dyn Any>>
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
.
Sourcefn sources(&self) -> &[Box<dyn ConfigurationSource>]
fn sources(&self) -> &[Box<dyn ConfigurationSource>]
Gets the registered ConfigurationSource
set used to obtain
configuration values.
Sourcefn add(&mut self, source: Box<dyn ConfigurationSource>)
fn add(&mut self, source: Box<dyn ConfigurationSource>)
Sourcefn build(&self) -> Result<Box<dyn ConfigurationRoot>, ReloadError>
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 + '_
impl ChainedBuilderExtensions for dyn ConfigurationBuilder + '_
Source§fn add_configuration(
&mut self,
configuration: Box<dyn Configuration>,
) -> &mut Self
fn add_configuration( &mut self, configuration: Box<dyn Configuration>, ) -> &mut Self
Adds the existing configuration. Read more
Source§impl CommandLineConfigurationBuilderExtensions for dyn ConfigurationBuilder + '_
impl CommandLineConfigurationBuilderExtensions for dyn ConfigurationBuilder + '_
Source§fn add_command_line(&mut self) -> &mut Self
fn add_command_line(&mut self) -> &mut Self
Adds the command line configuration source.
Source§impl EnvironmentVariablesExtensions for dyn ConfigurationBuilder + '_
impl EnvironmentVariablesExtensions for dyn ConfigurationBuilder + '_
Source§fn add_env_vars(&mut self) -> &mut Self
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
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 + '_
impl IniConfigurationExtensions for dyn ConfigurationBuilder + '_
Source§fn add_ini_file<T: Into<FileSource>>(&mut self, file: T) -> &mut Self
fn add_ini_file<T: Into<FileSource>>(&mut self, file: T) -> &mut Self
Adds an
*.ini
file as a configuration source. Read moreSource§impl JsonConfigurationExtensions for dyn ConfigurationBuilder + '_
impl JsonConfigurationExtensions for dyn ConfigurationBuilder + '_
Source§fn add_json_file<T: Into<FileSource>>(&mut self, file: T) -> &mut Self
fn add_json_file<T: Into<FileSource>>(&mut self, file: T) -> &mut Self
Adds a
*.json
file as a configuration source. Read moreSource§impl MemoryConfigurationBuilderExtensions for dyn ConfigurationBuilder + '_
impl MemoryConfigurationBuilderExtensions for dyn ConfigurationBuilder + '_
Source§impl XmlConfigurationExtensions for dyn ConfigurationBuilder + '_
impl XmlConfigurationExtensions for dyn ConfigurationBuilder + '_
Source§fn add_xml_file<T: Into<FileSource>>(&mut self, file: T) -> &mut Self
fn add_xml_file<T: Into<FileSource>>(&mut self, file: T) -> &mut Self
Adds a
*.xml
file as a configuration source. Read more