pub struct DefaultConfigurationSection { /* private fields */ }
Available on crate feature std only.
Expand description

Represent a configuration section.

Implementations§

source§

impl DefaultConfigurationSection

source

pub fn new(root: Box<dyn ConfigurationRoot>, path: &str) -> Self

Initializes a new configuration section.

Arguments
  • root - A reference to the ConfigurationRoot
  • path - The path of the configuration section

Trait Implementations§

source§

impl<'a> AsRef<dyn Configuration + 'a> for DefaultConfigurationSection

source§

fn as_ref(&self) -> &(dyn Configuration + 'a)

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'a> Borrow<dyn Configuration + 'a> for DefaultConfigurationSection

source§

fn borrow(&self) -> &(dyn Configuration + 'a)

Immutably borrows from an owned value. Read more
source§

impl Configuration for DefaultConfigurationSection

source§

fn get(&self, key: &str) -> Option<Value>

Gets the configuration value. Read more
source§

fn section(&self, key: &str) -> Box<dyn ConfigurationSection>

Gets a ConfigurationSection with the specified key.
source§

fn children(&self) -> Vec<Box<dyn ConfigurationSection>>

Gets the sequence of ConfigurationSection children.
source§

fn reload_token(&self) -> Box<dyn ChangeToken>

Returns a ChangeToken that can be used to observe when this configuration is reloaded.
source§

fn as_section(&self) -> Option<&dyn ConfigurationSection>

Attempts to convert the Configuration as a ConfigurationSection.
source§

fn iter( &self, path: Option<ConfigurationPath> ) -> Box<dyn Iterator<Item = (String, Value)>>

Gets an iterator of the key/value pairs within the Configuration. Read more
source§

impl ConfigurationSection for DefaultConfigurationSection

source§

fn key(&self) -> &str

Gets the key this section occupies in its parent.
source§

fn path(&self) -> &str

Gets the full path to this section within the Configuration.
source§

fn value(&self) -> Value

Gets the section value.
source§

impl Deref for DefaultConfigurationSection

§

type Target = dyn Configuration

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<C> ConfigurationBinder for C
where C: AsRef<dyn Configuration>,

source§

fn reify<T>(&self) -> T

Creates and returns a structure bound to the configuration.
source§

fn bind<T>(&self, instance: &mut T)

Binds the configuration to the specified instance. Read more
source§

fn bind_at<T>(&self, key: impl AsRef<str>, instance: &mut T)

Binds the specified configuration section to the provided instance. Read more
source§

fn get_value<T>( &self, key: impl AsRef<str> ) -> Result<Option<T>, <T as FromStr>::Err>
where T: FromStr,

Gets a typed value from the configuration. Read more
source§

fn get_value_or_default<T>( &self, key: impl AsRef<str> ) -> Result<T, <T as FromStr>::Err>
where T: FromStr + Default,

Gets an optional, typed value from the configuration. Read more
source§

impl<T> ConfigurationSectionExtensions for T

source§

fn exists(&self) -> bool

Gets a value indicating whether the configuration section exists. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.