pub fn encode_backend_config_json(
legacy_json: String,
backend: BackendCapabilities,
) -> Result<String>Expand description
Preserve the exact backend facts alongside an already encoded legacy config.
The legacy form couples some capabilities and omits others. When it can
express backend exactly, return legacy_json byte for byte, so a reader
of the legacy form reads it unchanged. Otherwise wrap it in a versioned
envelope whose typed backend replaces the legacy projection on decoding.
Non-backend fields keep the legacy form’s semantics in either case.