Skip to main content

configbuilder_pattern_loader/
loaded_feature.rs

1use crate::{FeatureRecord, FeatureState};
2
3/// The full result of loading an optional feature section.
4///
5/// Returned by [`crate::FeatureLoader::load_feature`] so callers can access both the
6/// strongly-typed config value and the metadata record in one call.
7/// [`crate::FeatureRegistry`] uses the record to build the startup feature summary.
8#[derive(Debug)]
9pub struct LoadedFeature<T> {
10    /// The feature state after applying all precedence rules:
11    /// env var > `enabled = false` TOML flag > section presence > absent.
12    pub state: FeatureState<T>,
13
14    /// Metadata describing how the state was determined.
15    pub record: Box<FeatureRecord>,
16}