pub enum ElementId {
Unexamined,
Fixed(i32),
Positional,
Meaningful,
Unenforced {
writes: i32,
why: &'static str,
},
}Expand description
The struct id the engine’s own writer puts on a list’s elements.
An enum rather than an optional number, because a positional id is a rule
the engine follows rather than the absence of one. Spelling it as None
would make absence carry an answer, which is the shape a whole liveness
axis was rebuilt to stop, and it would leave a list whose id nobody
established with no spelling of its own.
Variants§
Unexamined
Nobody has established what an element carries here.
What an entry declaring a label and modelling no element behind it gets. There is no element schema to hang an id on and this layer writes no element there, so an id would be a claim about an untouched list.
The default, so that an axis with no way of saying this cannot silently
answer Positional for every such entry. A modelled list has to
declare an id and the derive refuses it otherwise, so this variant
means the entry models nothing rather than that somebody forgot.
Fixed(i32)
Every element carries this id.
Positional
Each element carries its own index in the list.
Meaningful
The id is data: the engine reads the element’s struct id off the header rather than any field, so a writer has to preserve it and the model has to carry it somewhere.
Equip_ItemList is the case. Its id is the equipment slot, which no
label repeats, so an element written with the wrong one equips into the
wrong slot with nothing in the file to say so.
Unenforced
A value every writer puts there and no loader tests.
Distinct from Fixed, which is what a loader demands.
Where nothing checks, two writers can disagree without either being
wrong, and a corpus that shows them disagreeing is reporting the engine
rather than a defect. Saying Fixed there would claim an enforcement
nothing performs.
The reason is carried rather than described elsewhere, so a list cannot be marked unenforced without saying what was checked.