Trait config::Configuration
source · [−]pub trait Configuration {
fn get(&self, key: &str) -> Option<&str>;
fn section(&self, key: &str) -> Box<dyn ConfigurationSection>;
fn children(&self) -> Vec<Box<dyn ConfigurationSection>>;
fn reload_token(&self) -> Box<dyn ChangeToken>;
fn iter_relative(
&self,
make_paths_relative: bool
) -> Box<dyn Iterator<Item = (String, String)>>;
fn as_section(&self) -> Option<&dyn ConfigurationSection> { ... }
fn iter(&self) -> Box<dyn Iterator<Item = (String, String)>> { ... }
}Expand description
Defines the behavior of a configuration.
Required Methods
sourcefn section(&self, key: &str) -> Box<dyn ConfigurationSection>
fn section(&self, key: &str) -> Box<dyn ConfigurationSection>
Gets a configuration section with the specified key.
sourcefn children(&self) -> Vec<Box<dyn ConfigurationSection>>
fn children(&self) -> Vec<Box<dyn ConfigurationSection>>
Gets the sequence of child configuration sections.
sourcefn reload_token(&self) -> Box<dyn ChangeToken>
fn reload_token(&self) -> Box<dyn ChangeToken>
Returns a change token that can be used to observe when this configuration is reloaded.
sourcefn iter_relative(
&self,
make_paths_relative: bool
) -> Box<dyn Iterator<Item = (String, String)>>
fn iter_relative(
&self,
make_paths_relative: bool
) -> Box<dyn Iterator<Item = (String, String)>>
Gets an iterator of the key/value pairs within the configuration.
Arguments
make_paths_relative- If true, the child keys returned will have the current configuration’s path trimmed from the front
Provided Methods
sourcefn as_section(&self) -> Option<&dyn ConfigurationSection>
fn as_section(&self) -> Option<&dyn ConfigurationSection>
Attempts to convert the configuration as a configuration section.