cgp-serde v0.3.0
This page lists what cgp-serde v0.3.0 changed. cgp-serde rebuilds Serde's Serialize and
Deserialize traits as components of Context-Generic Programming (CGP), a Rust library
whose macros generate traits and their wiring, and this release moves it onto
cgp v0.8.0 and extends it to enums.
Released on 2026-11-18.
- Crate:
cgp-serde0.3.0 on crates.io - Compare: v0.2.0...v0.3.0
Summary
The library requires cgp 0.8.0, and SerializeFields is renamed SerializeRecordFields to
match DeserializeRecordFields. Three new providers serialize and deserialize enums, including
variants with no fields. Every published crate now has a README that is also its crate
documentation, and every public component, provider, and type has a doc comment.
Compatibility
- Minimum Rust version: 1.90.
- CGP version: built on
cgp0.8.0, released beside it. - Crates:
cgp-serde,cgp-serde-extra,cgp-serde-json,cgp-serde-alloc, andcgp-serde-typed-arena, all at 0.3.0.
Upgrading
- Move the project to
cgp0.8.0, following thecgpv0.8.0 notes; see Thecgprequirement is 0.8.0. - Replace
SerializeFieldswithSerializeRecordFieldsin the wiring; seeSerializeFieldsis renamed. - Change every cgp-serde crate's requirement to
0.3.0.
Breaking changes
The cgp requirement is 0.8.0
Every cgp-serde crate requires cgp 0.8.0 where v0.2.0 required 0.7.0, and cgp-serde's components
and a project's wiring of them must come from the same cgp release. The components keep their
names, parameters, and methods, so a project's cgp-serde wiring changes only where cgp 0.8.0's
syntax and prelude changed. A UseDelegate table still dispatches the components per value type,
and cgp 0.8.0's open statement does the same without one. Introduced in
#2.
SerializeFields is renamed
SerializeRecordFields is
the provider that writes a struct as a map of its fields, which v0.2.0 named SerializeFields; the
old name is gone. A context that wired SerializeFields wires SerializeRecordFields. Introduced
in #2.
New features
SerializeVariantFieldswrites an enum that derives CGP's variant list in Serde's externally tagged form,{"Variant": payload}, encoding the payload through the context. The enum must be'static. Introduced in #2.DeserializeVariantFieldsreads such an enum back, finding the variant by name in text formats and by index in binary ones. Introduced in #2.SerializeUnitwrites any value as Serde's unit and reads a unit into the type'sDefault. Wired forNil, the payload of a variant with no fields, it writes that variant as{"Variant": null}in JSON, unlike Serde's derive. Introduced in #2.
Improvements
- Crate documentation: each published crate's README is its crate documentation, so docs.rs and
crates.io show the same page, and
cgp-serde's runs its example as a doc test. Introduced in #2. - Doc comments: every public component trait, provider, and type has a doc comment, most linking its page in the website's reference; modules, methods, and struct fields do not yet have one. Introduced in #2.
- Package metadata: each crate's
repositorynames the cgp-serde repository, where v0.2.0 namedcgp's; each crate has a description of its own, ahomepage, keywords, and categories; and each package includes the license file. Introduced in #2.
An AI agent wrote this page from the release's source changes and the CGP knowledge base. Its content was verified against the library's source at the release's tag. See How AI is used in this project.