feat(rust): dynamic rust serializer system#2778
Merged
chaokunyang merged 41 commits intoapache:mainfrom Oct 19, 2025
Merged
Conversation
…tion ofr map data
a5de452 to
90c75e7
Compare
rajuyadav03
pushed a commit
to rajuyadav03/fory
that referenced
this pull request
Oct 20, 2025
## What does this PR do? This PR rewrite whole rust serializer to provide a much more clean, dynamic and flexible serializer system. Main changes inlucde: - New Serializer trait inferface: privide new `fory_write`/`fory_write_generic`/`fory_read`/`fory_read_with_type_info` API,, to allow control nested serialization behaviour - Provide `fory_static_type_id` to allow fast compile-time serializer dispatch - Implement fory collection/map dynamic xlang serialization protocol, make it work with trait object and shared/circular reference - Removed `is_field` parameter, it inotroduce lots of confusion to users - Rewrite whole error processing system, use static method instead, and support dump backtrace in apache#2780 - Add struct field read/write hook, support dump field write/read info and support register customized debug hook - Refactored the derive macro with better generated code - Move `fory_read_compatible` to `StrucSerializer` ## Related issues - Closes apache#2777 - Closes apache#2775 - Closes apache#2780 ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fory/issues/new/choose) describing the need to do so and update the document if necessary. Delete section if not applicable. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? ## Benchmark <!-- When the PR has an impact on performance (if you don't know whether the PR will have an impact on performance, you can submit the PR first, and if it will have impact on performance, the code reviewer will explain it), be sure to attach a benchmark data here. Delete section if not applicable. -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR rewrite whole rust serializer to provide a much more clean, dynamic and flexible serializer system. Main changes inlucde:
fory_write/fory_write_generic/fory_read/fory_read_with_type_infoAPI,, to allow control nested serialization behaviourfory_static_type_idto allow fast compile-time serializer dispatchis_fieldparameter, it inotroduce lots of confusion to usersfory_read_compatibletoStrucSerializerRelated issues
Does this PR introduce any user-facing change?
Benchmark