[][src]Trait preftool::Configuration

pub trait Configuration: Sized + Send + Sync + Clone {
type Section: ConfigurationSection;
type Sections: Iterator<Item = Self::Section>;
    fn get<K: Into<ConfigKey>>(&self, key: K) -> Option<&str>;
fn get_section<K: Into<ConfigKey>>(&self, key: K) -> Self::Section;
fn sections(&self) -> Self::Sections; }

Configuration trait. Configuration is thread safe, and cloneable. Clones should be cheap (default config object consits of cloning an Arc and 3 String instances).

Associated Types

type Section: ConfigurationSection

Type used for configuration sections.

type Sections: Iterator<Item = Self::Section>

Iterator type used to get child sections.

Loading content...

Required methods

fn get<K: Into<ConfigKey>>(&self, key: K) -> Option<&str>

Get a value from the configuration, if it exists.

fn get_section<K: Into<ConfigKey>>(&self, key: K) -> Self::Section

Get a sub-section from the configuration. This always returns a section, even if it is empty.

fn sections(&self) -> Self::Sections

Get all child sections of this configuration, as an iterator.

Loading content...

Implementors

Loading content...