Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Changelog

0.1.1

Breaking changes

  • #[mini(flatten = "field1, field2, ...")] field lists are now ignored (previously required when combining multiple struct flattens). Existing code using field lists still compiles but the lists have no effect. Remove them at your convenience.

Improvements

  • Streaming flatten deserialization: Struct flatten fields are now deserialized via FlattenMap::accepts_key routing, eliminating the buffer-and-replay double-parse overhead. Only HashMap/BTreeMap flatten fields still use buffering.
  • Streaming flatten serialization: All flatten fields (struct and map) are now serialized via SerializeMapBuilder::create_ser_map, streaming entries directly without an intermediate Value allocation. Midiserde adds SerializeMapBuilder impls for HashMap and BTreeMap, extracting the Fragment::Map from their existing miniserde::Serialize::begin(), so map flatten no longer uses to_value + buffer.
  • Multiple struct flattens: Any number of #[mini(flatten)] struct fields are supported in a single parent, with no ordering constraints and no field-list annotations.
  • New public traits: FlattenMap<T>, FlattenDeserialize, and SerializeMapBuilder are generated for every derived struct, enabling efficient programmatic flatten composition.
  • Compile-time validation: At most one map (HashMap/BTreeMap) flatten field is allowed per struct; a clear error is emitted otherwise.

Unreleased