Skip to content

Conversation

@chaokunyang
Copy link
Collaborator

@chaokunyang chaokunyang commented Oct 19, 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 [Rust] Support get error callstack when serialize/deserialize failed #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

Does this PR introduce any user-facing change?

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

@chaokunyang chaokunyang requested review from pandalee99, theweipeng and urlyy and removed request for PragmaTwice and theweipeng October 19, 2025 05:59
@chaokunyang chaokunyang changed the title feat(rust): new rust serializer system feat(rust): dynamic rust serializer system Oct 19, 2025
Copy link
Contributor

@pandalee99 pandalee99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

@chaokunyang chaokunyang mentioned this pull request Oct 19, 2025
17 tasks
@chaokunyang chaokunyang force-pushed the refactor_rust_serializer branch from a5de452 to 90c75e7 Compare October 19, 2025 18:28
@chaokunyang chaokunyang merged commit c1b7d80 into apache:main Oct 19, 2025
53 checks passed
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.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants