xmpp-rs/xso-proc/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jonas Schäfer 0fd69d2ff8 xso-proc: fix order-dependent compilation bug
The test case which is added fails to compile unless one puts the
`parent` field before the `id` field. The cause is explained somewhat by
the change, but I'll spell it out here nontheless.

Previously, the loop in `Compound::make_as_item_iter_statemachine`
assumed that the serialisation order of fields would match their
declaration order. That is not generally true: attributes must be
serialised before element content, because they must be emitted before
the element header is closed.

This change thus splits the generated states into "header" states (for
everything before the end of the element header (think `>`)) and
"body" states (for everything after and including the end of the
element header). After all fields have been processed, we can then
add the data fields of the body fields to the header states so that
they are carried through the generated state machine until they are
needed in the body.
2025-04-18 12:41:12 +02:00
..
field xso: add support for post-deserialization callback 2025-04-18 10:49:26 +02:00
common.rs xso-proc: introduce trait for StructDef 2024-08-01 15:26:38 +02:00
compound.rs xso-proc: fix order-dependent compilation bug 2025-04-18 12:41:12 +02:00
enums.rs xso: add support for post-deserialization callback 2025-04-18 10:49:26 +02:00
error_message.rs xso-proc: clippy run 2025-04-08 12:47:56 +02:00
lib.rs Revert "xso-proc: Replace std stuff with alloc/core stuff" 2025-01-20 17:52:35 +01:00
meta.rs xso: add support for post-deserialization callback 2025-04-18 10:49:26 +02:00
scope.rs xso: implement support for extracting data from child elements 2024-08-03 15:17:30 +02:00
state.rs xso: add support for post-deserialization callback 2025-04-18 10:49:26 +02:00
structs.rs xso: add support for post-deserialization callback 2025-04-18 10:49:26 +02:00
types.rs xso-proc: clippy run 2025-04-08 12:47:56 +02:00