pub enum WriteRules {
UnityPy,
MirrorReader,
}Expand description
The writer’s alignment rules.
Variants§
UnityPy
UnityPy’s write_value: an array element whose node carries the align
flag aligns after every element, where the reader aligns once after a
run. The oracle’s L3 behaviour, and the default.
MirrorReader
Write as the reader that built the value reads (Parsed::read_by).
For UnityPyBoost’s: align once after a flagged primitive or pair
run, write no data where the reader skipped it (a class whose size
field is 0, or a matched ref type with no tree), and take a type name
to its first NUL. For the pure-Python reader’s: take a type name
whole, write a flagged array’s elements as read_value_array reads
them (each kind without its own trailing alignment, the run aligned
once after; a pair‘s primitive, string or bytes children without
their own flags, its 16-bit ones unswapped; a class’s registry
children with no registry check; a run of 16-bit integers with their
signedness swapped), align no empty string after itself (so not at
all where that reader reads no flag: a run’s element, a flagged
pair run’s child), and write no data for an empty class or a
matched ref type with no tree. A value either reader reads through a tree that
repeats no name writes back to bytes the same reader reads as the
same value (padding as zeros), unless the pure-Python reader moved
its position other than forward over what it holds (a negative
TypelessData length, or one past the end) or started at a position
not a multiple of 4 (it aligns to the file, the writer to the
object); a repeated name keeps only its last value, so no writer
gives back the others’ bytes (plan 3.11; a PARITY.md Tier C
option; tests/walk_mirror.rs).