pub struct Layer { /* private fields */ }Expand description
One layer of configuration, flattened to its leaf settings.
Implementations§
Source§impl Layer
impl Layer
Sourcepub fn new(settings: Vec<Setting>) -> Self
pub fn new(settings: Vec<Setting>) -> Self
A layer holding exactly settings, in the order given.
Sourcepub fn from_document(
path: PathBuf,
document: &Value,
) -> Result<Self, ConfigError>
pub fn from_document( path: PathBuf, document: &Value, ) -> Result<Self, ConfigError>
Flatten one parsed document into a layer attributed to path.
An empty document contributes nothing, which is what a file holding only comments should do.
§Errors
Returns ConfigError::Setting when the document’s root is not a mapping.
A document that is a list or a bare scalar sets no setting at all, and
accepting it silently would make a whole misplaced file read as “unset”.
Trait Implementations§
impl StructuralPartialEq for Layer
Auto Trait Implementations§
impl Freeze for Layer
impl RefUnwindSafe for Layer
impl Send for Layer
impl Sync for Layer
impl Unpin for Layer
impl UnsafeUnpin for Layer
impl UnwindSafe for Layer
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