pub fn load_and_upgrade(
declared: ConfigVersion,
data: &[u8],
apply_latest_defaults: bool,
) -> Result<CaproniConfig, ConfigError>Expand description
Constructs the declared version’s struct, unmarshals data into it, applies defaults, and walks the upgrade chain to the latest config.
apply_latest_defaults controls the load-vs-seed defaults asymmetry: the
load path passes true (a native-latest config is defaulted); the seed
path passes false (a native-latest config is NOT defaulted). A
non-latest declared version is always defaulted, because its conversion
depends on its own version’s defaults having run — moot today since only
Version2 (the latest) is registered, but kept for fidelity with the Go
original’s declared != LatestVersion || applyLatestDefaults condition.