configbuilder-pattern-loader 0.1.0

configbuilder-pattern: loader domain, trait contract + tech-agnostic reference implementation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::{FeatureRecord, FeatureState};

/// The full result of loading an optional feature section.
///
/// Returned by [`crate::FeatureLoader::load_feature`] so callers can access both the
/// strongly-typed config value and the metadata record in one call.
/// [`crate::FeatureRegistry`] uses the record to build the startup feature summary.
#[derive(Debug)]
pub struct LoadedFeature<T> {
    /// The feature state after applying all precedence rules:
    /// env var > `enabled = false` TOML flag > section presence > absent.
    pub state: FeatureState<T>,

    /// Metadata describing how the state was determined.
    pub record: Box<FeatureRecord>,
}