diff --git a/src/config/layers.rs b/src/config/layers.rs index c84a516..f209789 100644 --- a/src/config/layers.rs +++ b/src/config/layers.rs @@ -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 { + self.0.iter() + } } diff --git a/src/object/mod.rs b/src/object/mod.rs index 847dc92..19fe484 100644 --- a/src/object/mod.rs +++ b/src/object/mod.rs @@ -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)]