Struct DefaultConfigurationBuilder

Source
pub struct DefaultConfigurationBuilder {
    pub sources: Vec<Box<dyn ConfigurationSource>>,
    pub properties: HashMap<String, Box<dyn Any>>,
}
Available on crate feature std only.
Expand description

Represents a configuration builder.

Fields§

§sources: Vec<Box<dyn ConfigurationSource>>

Gets the associated configuration sources.

§properties: HashMap<String, Box<dyn Any>>

Gets the properties that can be passed to configuration sources.

Implementations§

Source§

impl DefaultConfigurationBuilder

Source

pub fn new() -> Self

Initializes a new, default configuration builder.

Trait Implementations§

Source§

impl ConfigurationBuilder for DefaultConfigurationBuilder

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. Read more
Source§

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

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

impl Default for DefaultConfigurationBuilder

Source§

fn default() -> DefaultConfigurationBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ChainedBuilderExtensions for T

Source§

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

Adds the existing configuration. Read more
Source§

impl<T> CommandLineConfigurationBuilderExtensions for T

Source§

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

Adds the command line configuration source.
Source§

fn add_command_line_map<S>(&mut self, switch_mappings: &[(S, S)]) -> &mut T
where S: AsRef<str>,

Adds the command line configuration source. Read more
Source§

impl<T> EnvironmentVariablesExtensions for T

Source§

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

Adds environment variables as a configuration source.
Source§

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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> IniConfigurationExtensions for T

Source§

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

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> JsonConfigurationExtensions for T

Source§

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

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

impl<T> MemoryConfigurationBuilderExtensions for T

Source§

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

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> XmlConfigurationExtensions for T

Source§

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

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