Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/config/layers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,15 @@ impl Layers {

Ok(None)
}

/// Iterate over the individual layers
///
/// This function returns an iterator that can be used to iterate over the individual layers of
/// the configuration.
///
/// This is useful if you want to access all values of each layer (even the shadowed ones) for
/// example for debug analysis of the loaded configuration values.
pub fn iter(&self) -> impl Iterator<Item = &ConfigObject> {
self.0.iter()
}
}
5 changes: 5 additions & 0 deletions src/object/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ impl ConfigObject {
Ok(None)
}
}

/// Get the configuration element that the object wraps
pub fn element(&self) -> &dyn ConfigElement {
&*self.element
}
}

#[derive(Debug, thiserror::Error)]
Expand Down