pub struct Config { /* private fields */ }Expand description
Configuration values merged in source insertion order.
Implementations§
Source§impl Config
impl Config
Sourcepub fn parse<T: Configuration>(&self) -> ConfigurationResult<T>
pub fn parse<T: Configuration>(&self) -> ConfigurationResult<T>
Parses a typed view without loading any additional configuration sources.
Sourcepub fn source_of(&self, key: &str) -> Option<&str>
pub fn source_of(&self, key: &str) -> Option<&str>
Returns the source name for a configuration key.
Sourcepub fn contains_table(&self, key: &str) -> bool
pub fn contains_table(&self, key: &str) -> bool
Returns whether a source declared a TOML table at key.
Sourcepub fn table_source(&self, key: &str) -> Option<&str>
pub fn table_source(&self, key: &str) -> Option<&str>
Returns the source name for a declared TOML table.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &ConfigValue)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &ConfigValue)>
Iterates over keys and their attributed values in lexical key order.
Sourcepub fn get_string_array(&self, key: &str) -> Option<&[String]>
pub fn get_string_array(&self, key: &str) -> Option<&[String]>
Returns a string-array configuration value by key.
Sourcepub fn source_of_string_array(&self, key: &str) -> Option<&str>
pub fn source_of_string_array(&self, key: &str) -> Option<&str>
Returns the source name for a string-array configuration key.
Sourcepub fn resolve_path(&self, key: &str) -> Option<PathBuf>
pub fn resolve_path(&self, key: &str) -> Option<PathBuf>
Resolves a scalar path value relative to the source that supplied it.
Sourcepub fn iter_string_arrays(&self) -> impl Iterator<Item = (&str, &[String])>
pub fn iter_string_arrays(&self) -> impl Iterator<Item = (&str, &[String])>
Iterates over string-array keys and values in lexical key order.
Trait Implementations§
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Forget for Config
impl Freeze for Config
impl Move for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.