pub struct ConfigurationTree(/* private fields */);Expand description
A set of configuration fields, represented as a set of nested K=V mappings.
(This is a wrapper for an underlying type provided by the library that actually does our configuration.)
Implementations§
Source§impl ConfigurationTree
impl ConfigurationTree
Sourcepub fn get_serde_value<T: DeserializeOwned>(
&self,
key: &str,
) -> Result<Option<T>, ConfigGetValueError>
pub fn get_serde_value<T: DeserializeOwned>( &self, key: &str, ) -> Result<Option<T>, ConfigGetValueError>
Return the value with a given key as some type that implements Deserialize.
Return None if no such value is set in this tree.
Sourcepub fn merge_from<T>(&mut self, config: &T) -> Result<(), ConfigError>where
T: Serialize,
pub fn merge_from<T>(&mut self, config: &T) -> Result<(), ConfigError>where
T: Serialize,
Override our current tree with the settings in config.
config must be implement Serialize,
and must serialize to a map.
This operation follows the same as are used when reading multiple configuration files in sequence, where option settings in later files replace earlier ones.
Trait Implementations§
Source§impl Clone for ConfigurationTree
impl Clone for ConfigurationTree
Source§fn clone(&self) -> ConfigurationTree
fn clone(&self) -> ConfigurationTree
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigurationTree
impl Debug for ConfigurationTree
Source§impl Default for ConfigurationTree
impl Default for ConfigurationTree
Source§fn default() -> ConfigurationTree
fn default() -> ConfigurationTree
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConfigurationTree
impl !RefUnwindSafe for ConfigurationTree
impl Send for ConfigurationTree
impl Sync for ConfigurationTree
impl Unpin for ConfigurationTree
impl UnsafeUnpin for ConfigurationTree
impl !UnwindSafe for ConfigurationTree
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more