Trait config::ConfigurationProvider
source · [−]pub trait ConfigurationProvider {
fn get(&self, key: &str) -> Option<&str>;
fn child_keys(
&self,
earlier_keys: &mut Vec<String>,
parent_path: Option<&str>
);
fn name(&self) -> &str { ... }
fn reload_token(&self) -> Option<Box<dyn ChangeToken>> { ... }
fn load(&mut self) { ... }
}Expand description
Defines the behavior of an object that provides configuration key/values for an application.
Required Methods
sourcefn get(&self, key: &str) -> Option<&str>
fn get(&self, key: &str) -> Option<&str>
Attempts to get a configuration value with the specified key.
Arguments
key- The key of the value to retrieve
sourcefn child_keys(&self, earlier_keys: &mut Vec<String>, parent_path: Option<&str>)
fn child_keys(&self, earlier_keys: &mut Vec<String>, parent_path: Option<&str>)
Gets the immediate descendent configuration keys for a given parent path based on this provider and the set of keys returned by all of the preceding providers.
Arguments
earlier_keys- The sequence of keys returned by preceding provider for the same parent pathparent_path- The optional parent path to evaluate
Provided Methods
sourcefn reload_token(&self) -> Option<Box<dyn ChangeToken>>
fn reload_token(&self) -> Option<Box<dyn ChangeToken>>
Returns a change token if this provider supports change tracking.