Rust / Nested leaf merge
Rust Struct Literal Leaf Merge
This page has a stable URL for review, documentation, and implementation comparison. The fixture tabs show merge inputs and output; the contract tabs show JSON and compact ruleset renderings with stable IDs and deterministic ownership.
Advanced .rs advanced leaf mergenested leavesdestination leaf winsruststruct_literal_leavesstructural_signaturenative_read_portable_writenormalize_tracked_layout_merge
Fixture sources
JSON fixture: structuredmerge-fixtures/rust/slice-720-advanced-leaf-merge/struct-literal-leaf-merge.json
Compact ruleset: structuredmerge-fixtures/rulesets/rust/slice-720-advanced-leaf-merge/struct-literal-leaf-merge.smrules
Fixture view
pub fn summary() -> PatientSummary {
PatientSummary {
profile: Profile {
name: Name { given: "Pat".into(), family: "Template".into() },
contact: Contact { email: "[email protected]".into(), phone: Some("555-0100".into()) },
care_plan: CarePlan { status: "draft".into(), goals: Goals { mobility: "walk daily".into(), nutrition: "low sodium".into() } },
},
}
}
Contract view
{
"contract_id": "rust-struct-literal-leaf-merge",
"format": "rust",
"owners": "struct_literal_leaves",
"match": "structural_signature",
"read": "native_read_portable_write",
"attach": "normalize_tracked_layout_merge",
"comment_style": "c_style_line",
"render": "rust_items",
"surfaces": [
{
"name": "struct_literal_field",
"selector": "stable_path"
}
],
"capabilities": {
"nested_leaf_merge": true,
"destination_leaf_wins": true,
"template_missing_leaf_adds": true
}
}