pub struct TracedConfig<T> { /* private fields */ }Expand description
Configuration with tracing information.
This type wraps a Config<T> with additional trace data that shows
where each configuration value came from and its override history.
Implementations§
Source§impl<T> TracedConfig<T>
impl<T> TracedConfig<T>
Sourcepub fn new(config: Config<T>, traces: BTreeMap<String, ValueTrace>) -> Self
pub fn new(config: Config<T>, traces: BTreeMap<String, ValueTrace>) -> Self
Create a new traced config from a config and traces.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume and return the configuration value.
Sourcepub fn into_config(self) -> Config<T>
pub fn into_config(self) -> Config<T>
Consume and return the inner Config.
Sourcepub fn trace(&self, path: &str) -> Option<&ValueTrace>
pub fn trace(&self, path: &str) -> Option<&ValueTrace>
Get the trace for a specific path.
Sourcepub fn was_overridden(&self, path: &str) -> bool
pub fn was_overridden(&self, path: &str) -> bool
Check if a path was overridden by a higher-priority source.
Sourcepub fn traces(&self) -> impl Iterator<Item = (&str, &ValueTrace)>
pub fn traces(&self) -> impl Iterator<Item = (&str, &ValueTrace)>
Get all traces.
Sourcepub fn overridden_paths(&self) -> impl Iterator<Item = &str>
pub fn overridden_paths(&self) -> impl Iterator<Item = &str>
Get paths that were overridden.
Sourcepub fn trace_count(&self) -> usize
pub fn trace_count(&self) -> usize
Get the number of traced paths.
Sourcepub fn trace_report(&self) -> String
pub fn trace_report(&self) -> String
Generate a human-readable trace report.
Trait Implementations§
Source§impl<T> AsRef<T> for TracedConfig<T>
impl<T> AsRef<T> for TracedConfig<T>
Source§impl<T: Debug> Debug for TracedConfig<T>
impl<T: Debug> Debug for TracedConfig<T>
Auto Trait Implementations§
impl<T> Freeze for TracedConfig<T>where
T: Freeze,
impl<T> RefUnwindSafe for TracedConfig<T>where
T: RefUnwindSafe,
impl<T> Send for TracedConfig<T>where
T: Send,
impl<T> Sync for TracedConfig<T>where
T: Sync,
impl<T> Unpin for TracedConfig<T>where
T: Unpin,
impl<T> UnwindSafe for TracedConfig<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more