pub struct Split {
pub selector: GffLabel,
pub when_set: &'static [&'static [Field]],
pub when_clear: &'static [&'static [Field]],
}Expand description
A list whose elements carry extra fields chosen by a sibling of the list.
An addition to a list rather than a kind of list, which is what the GIT
case turned out to need. UseTemplates sits at the root beside every
object list and decides, for all of them at once, whether an element points
at a blueprint or carries the object whole. The selector is a sibling, so
resolving a shape needs only the struct the list was found on, and its own
entry says what its absence means rather than this restating it.
Two whole schemas was the first shape and it did not survive contact with
the corpus: a Creature List element carries one label in the templated
form only, 106 in the saved form only, and five in both. Those five would
have been restated in each arm, with their own liveness and absent-value,
on every object list using the shape. As an addition they are simply the
element schema, declared once.
Fields§
§selector: GffLabelLabel of the sibling that decides which extras apply.
when_set: &'static [&'static [Field]]Extra fields where the selector is set, in parts.
Parts rather than one slice, for the reason every other container takes parts: an arm that flattens a block would otherwise lose it, and GIT’s saved arms flatten four apiece. The arm contributes its whole schema here, so the element it shares with the other arm is held as a plain member and written by the arm’s own codec rather than flattened, which is what keeps the common block one declaration.
when_clear: &'static [&'static [Field]]Extra fields where it is clear or absent, in parts.