Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[serialization] Add canonical serialize/deserialize traits + derive macros #7

Merged
merged 7 commits into from
Feb 12, 2025

Conversation

bergkvist
Copy link
Contributor

Introduces the following traits:

  • SerializeCanonical (which replaces most uses of SerializeBytes)
  • DeserializeCanonical (which replaces most uses of DeserializeBytes)

Conveniently, this also comes with proc-macros for deriving these traits for an arbitrary struct/enum (unions are not supported).

@bergkvist bergkvist requested review from onesk and Anex007 February 6, 2025 03:27
Anex007
Anex007 previously approved these changes Feb 6, 2025
Copy link
Contributor

@Anex007 Anex007 left a comment

Choose a reason for hiding this comment

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

Looks good to me, Now I wonder if there's a reason for keeping DeserializeBytes/SerializeBytes in the utils crate, as we seem to use this only internally inside the field crate.

Anex007
Anex007 previously approved these changes Feb 7, 2025
Copy link
Contributor

@Anex007 Anex007 left a comment

Choose a reason for hiding this comment

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

Nice

@bergkvist bergkvist force-pushed the tobias/canonical-ser-des branch from 916a91d to 72554c4 Compare February 10, 2025 18:50
@jimpo-ulvt jimpo-ulvt force-pushed the tobias/canonical-ser-des branch from 72554c4 to 87d2e30 Compare February 12, 2025 12:03
@jimpo-ulvt jimpo-ulvt merged commit 33f94b8 into main Feb 12, 2025
3 checks passed
@jimpo-ulvt jimpo-ulvt deleted the tobias/canonical-ser-des branch February 12, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants