configbuilder-pattern-loader 0.1.0

configbuilder-pattern: loader domain, trait contract + tech-agnostic reference implementation.
Documentation
use crate::{FeatureMetadata, OverrideSource};

/// A snapshot of one optional feature's resolved state.
///
/// Collected by [`crate::FeatureRegistry`] as each feature is loaded, so the registry
/// can produce a startup summary of every registered feature.
///
/// Construct via [`crate::FeatureRecordBuilder`] rather than struct literal syntax, as
/// new fields may be added without a semver bump.
#[derive(Debug, Clone)]
pub struct FeatureRecord {
    /// The TOML section key for this feature (e.g. `"message_broker"`).
    pub section_name: String,

    /// Whether the feature resolved to enabled after applying all precedence rules.
    pub enabled: bool,

    /// Which external control overrode the natural TOML state, if any.
    pub override_source: Option<OverrideSource>,

    /// Section keys this feature declared it depends on via
    /// [`crate::OptionalSection::requires`].
    pub requires: &'static [&'static str],

    /// Static annotations (description, owner, deprecation) declared by the
    /// feature via [`crate::OptionalSection::metadata`].
    pub metadata: Box<FeatureMetadata>,
}