[−][src]Struct manaconf::Section
A section of configuration
This acts as a pre-applied prefix to a config key when fetching values
Example
let section = config.section("My::Config::Section"); // This is now the same as requesting `My::Config::Section::Value` let value: String = section.get_value("Value");
Implementations
impl<'a> Section<'a>
[src]
pub fn section<K: AsRef<Key>>(&self, key: K) -> Section
[src]
Creates a further subsection from this section, similar to a section
created by calling Config::section
, except in this case the current
sections prefix is prepended to the key
passed into section
Example
let section = config.section("first"); let subsection = section.section("second"); // Will read value from "first::second::value" let value: String = subsection.get_value("value");
Trait Implementations
impl<'a> ValueRead for Section<'a>
[src]
fn get_value<T, K>(&self, key: K) -> Result<Option<T>, ValueReadError> where
K: AsRef<Key>,
T: TryFromValue,
[src]
K: AsRef<Key>,
T: TryFromValue,
fn get_expected_value<T, K>(&self, key: K) -> Result<T, ValueReadError> where
K: AsRef<Key>,
T: TryFromValue,
[src]
K: AsRef<Key>,
T: TryFromValue,
fn bind<T: TryFromValueRead>(&self) -> Result<T, ValueReadError>
[src]
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Section<'a>
impl<'a> !Send for Section<'a>
impl<'a> !Sync for Section<'a>
impl<'a> Unpin for Section<'a>
impl<'a> !UnwindSafe for Section<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,