Skip to main content

elide_renumbers_successor

Function elide_renumbers_successor 

Source
fn elide_renumbers_successor(unit: &Unit<'_>) -> bool
Expand description

Whether eliding this object leaves the framer owing a successor fix-up.

Mirrors ObjectFramer::elide_owes_a_fixup, which is private to framer.rs, and the two stream kinds owe it from different drafts. A subgroup stream delta-encodes object IDs from draft-14, so the one object following an elided run has its leading ID varint rewritten. A fetch stream owes it from draft-15, where a Serialization Flags field lets a frame take any of its Group ID, Subgroup ID, Object ID and Priority from the frame before it, and the payment is a re-encode of the survivor’s whole framing rather than a rewrite of one varint. Drafts 07-13 subgroup streams and 07-14 fetch streams state every field outright and owe nothing.

Duplicated rather than borrowed because the value is needed before framer.note_elided(meta) is called — the effect is reported at the decision, and note_elided is what arms the fix-up. elide_renumbering_names_the_drafts_that_owe_a_fixup restates the table explicitly; see its comment for why it cannot ask the framer directly, and what covers the gap.

Both arms are exhaustive matches rather than matches!. false here means eliding this object costs the next one nothing, which is the answer that forwards a stream whose remaining Locations no longer decode — so a draft that arrives without an answer must stop the build rather than take that one. The two boundaries differ (subgroup from 14, fetch from 15), which is exactly why neither can be extrapolated from the other.