/// Records which external control overrode a feature's natural TOML state.
///
/// When [`crate::FeatureRecord::override_source`] is `Some`, the feature's
/// enabled/disabled state was forced by one of these mechanisms rather than
/// simple section presence.
#[derive(Debug, Clone)]
pub enum OverrideSource {
/// An environment variable forced this feature on or off.
EnvVar {
/// The full environment variable name (e.g. `CONFIGBUILDER_FEATURE_MESSAGE_BROKER`).
var_name: String,
/// The raw value that was set (e.g. `"false"`, `"true"`, `"0"`).
value: String,
},
/// The TOML section is present but `enabled = false` was set explicitly.
ExplicitTomlFlag,
/// The section was present and deserialised but `validate_enabled` failed,
/// and the feature's `OnError` policy is `OnError::Disable`.
ValidationError {
/// The string representation of the `validate_enabled` error.
reason: String,
},
}