Highlights
- Support rust enum variant and schema evolution for tuple/struct style enum
- Support rust tuple serialization and schema evolution
- Support rust skip macro attributes
Enum Schema Evolution
Fory v0.13.1 adds comprehensive enum schema evolution in Compatible mode, supporting all three variant types (Unit, Unnamed, Named):
- Add/remove variants: Unknown variants fall back to
#[fory(default)] - Add/remove fields: Named variants support field evolution with automatic defaults
- Modify elements: Unnamed variants handle element count changes (extras skipped, missing use defaults)
- Variant type changes: Convert between Unit/Unnamed/Named with automatic default values
// Version 1
#[derive(ForyObject)]
enum Command {
#[fory(default)]
Noop,
Execute { name: String, args: i32 },
}
// Version 2 - Added field and new variant
// both `fory(default)` and standard `default` are supported
#[derive(Default, ForyObject)]
enum Command {
#[default]
Noop,
Execute { name: String, args: i32, env: String }, // Added 'env'
Cancel { reason: String }, // New variant
}
// V1→V2: Missing 'env' gets default ""; Cancel→Noop fallback in V1
// V2→V1: Extra 'env' skipped; Cancel→Noop fallbackTuple Schema Evolution
Tuples (1-22 elements) now support length evolution in Compatible mode:
- Length changes: Grow or shrink tuple size (missing elements get defaults, extras discarded)
- Collections:
Vec,HashMap,HashSetelements fully supported - Nested tuples: Multi-level nesting with independent evolution per level
- Smart pointers:
Option,Arc,Rcwrapped elements handle evolution correctly - Struct fields: Tuple fields in structs evolve independently
let fory = Fory::default().compatible(true);
// Serialize 2-element tuple
let short = (42i32, "hello".to_string());
let bin = fory.serialize(&short).unwrap();
// Deserialize as 4-element tuple - extras get defaults
let long: (i32, String, f64, bool) = fory.deserialize(&bin).unwrap();
assert_eq!(long, (42, "hello".to_string(), 0.0, false));
// Reverse: 4→2 elements, extras discarded
let long = (100i32, "world".to_string(), 3.14, true);
let bin = fory.serialize(&long).unwrap();
let short: (i32, String) = fory.deserialize(&bin).unwrap();
assert_eq!(short, (100, "world".to_string()));Features
- feat(rust): add rust benchmark report script and result by @chaokunyang in #2835
- feat(rust): rust benchmark print serialized data size by @chaokunyang in #2845
- feat(rust): Support rust tagged union enum by @urlyy in #2855
- feat(rust): support unsigned number for rust by @chaokunyang in #2857
- feat(rust): support rust tuple serialization and schema evolution by @chaokunyang in #2858
- feat(go): implement new field ordering and type hash algorithm by @ThisingL in #2868
- feat: support fory skip macro attributes(#2864) by @kitty-eu-org in #2865
- feat(Rust): Support usize by @urlyy in #2870
- feat(rust): make whether write type/ref compile-time evaluation by @chaokunyang in #2871
- feat(rust): add array support for rust by @chaokunyang in #2874
- feat(rust): support enum variant for schema evolution mode by @chaokunyang in #2873
Bug Fix
- fix: fix 0.14.0 snapshot version by @chaokunyang in #2842
- fix(java): setting the ForyJitCompilerThreadFactory to produce daemon threads by @coderunner234 in #2869
- fix: modify the depth setting in Fory to prevent duplicate registrations. by @mengnankkkk in #2852
Other Improvements
- docs(rust): update rust benchmark report table by @chaokunyang in #2836
- chore(rust): update cargo toml for publish by @chaokunyang in #2838
- chore: bump release version to 0.13.0 by @chaokunyang in #2841
- docs: fix doc sync dest by @chaokunyang in #2839
- docs: refactor readme by @chaokunyang in #2843
- docs: add AGENTS to readme by @chaokunyang in #2844
- chore: remove agents from main readme by @chaokunyang in #2846
- docs: update readme by @chaokunyang in #2847
- docs: fix xlang type mapping link by @chaokunyang in #2848
- chore(Java): Make RustXlangTest cases independent from each other by @urlyy in #2834
- chore(java): Remove print property names by @Danden1 in #2860
- chore(python): add py3.13 release flag by @chaokunyang in #2872
- chore(rust): add tests to use #[derive(ForyObject)] in macro_rules! by @REASY in #2867
New Contributors
- @Danden1 made their first contribution in #2860
- @coderunner234 made their first contribution in #2869
- @REASY made their first contribution in #2867
Full Changelog: v0.13.0...v0.13.1