Skip to content

v0.6.0

Choose a tag to compare

@joaquinbejar joaquinbejar released this 12 Sep 08:02
· 22 commits to main since this release

Added

  • codegen: <data> (variable-length) fields inside repeating group entries are now generated instead of rejected (#61, #62). Entry decoders expose <name>() / <name>_as_str() and end_offset(); entry encoders expose set_<name>(&[u8]). SBE 1.0 lays out an entry as fixed fields, then nested groups, then var data, and the generated codecs follow that order.
  • codegen: nested repeating groups are reachable from entry codecs: entry.<group>() on decoders and entry.<group>_count(n) on encoders (#62). Until now the nested types were emitted but nothing reached them.
  • codegen: group decoders gain end_offset(), O(1) for fixed-stride groups and a walk over the remaining entries otherwise; group encoders gain count().

Changed

  • codegen: generated encoders thread one write cursor from the message encoder through group and entry encoders. <Group>Encoder::wrap(buffer, limit: &mut usize, count) replaces wrap(buffer, offset, count), and the group encoder's encoded_length() reports the bytes written so far instead of 4 + BLOCK_LENGTH * count. Entries of groups that carry nested groups or var data take the cursor as a third wrap argument; entries of flat groups keep the 0.5 shape. The ironsbe-codegen crate's own Rust API is unchanged (cargo semver-checks --release-type patch passes all 223 checks against 0.5.0).
  • codegen: message decoders position later groups and message-level var data after the true end of a variable-stride group by walking each group's end_offset(). Flat groups keep byte-identical wire output and O(1) positioning.
  • codegen: private decoder helpers are prefixed sbe_ (sbe_group_offset, sbe_<name>_offset) so schema field names such as groupOffset cannot collide with them.
  • codegen: messages.rs is split into fields.rs, var_data.rs and groups.rs; no change in generated output for existing schemas.

Testing

  • ironsbe-codegen-tests covers the issue #61 schema shape and a nested-group schema with 10 new compiled round-trips, including exact wire bytes and a flat group placed after a variable one.

Known follow-ups

  • Unwritten <data> fields are not guarded by the generated encoders (#63).
  • Random access after a variable-stride group re-walks it on every call; a sequential cursor-style decoder is tracked in #64.

Full changelog: v0.5.0...v0.6.0