pub struct Config { /* private fields */ }Expand description
A merged configuration, and where each of its values came from.
Implementations§
Source§impl Config
impl Config
Sourcepub fn origin_of(&self, path: &str) -> Option<&Origin>
pub fn origin_of(&self, path: &str) -> Option<&Origin>
Where the value at a dotted path came from.
This is the question a layered configuration exists to answer.
Sourcepub fn push(&mut self, node: Node, source: String) -> Result<(), ConfigError>
pub fn push(&mut self, node: Node, source: String) -> Result<(), ConfigError>
Merges one more source in, after everything already there. A refused layer leaves both the effective tree and source list unchanged.
§Errors
Whatever Node::merge reports.
Sourcepub fn push_each(
&mut self,
nodes: Vec<Node>,
source: String,
) -> Result<(), ConfigError>
pub fn push_each( &mut self, nodes: Vec<Node>, source: String, ) -> Result<(), ConfigError>
Merges several trees in, one after another, as one source. Each
tree’s +name appends to what the ones before it left, which one
pre-merged tree could not express. All or nothing, like Self::push.
§Errors
Whatever Node::merge reports.
Trait Implementations§
Auto Trait Implementations§
impl Freeze 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