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

Generate deserializers dynamically for nested types #95

Merged
merged 2 commits into from
Dec 30, 2020

Conversation

rcoh
Copy link
Collaborator

@rcoh rcoh commented Dec 22, 2020

Description of changes:

This code replaces the hand-written deserializers that were used to serialize types like Instant & Blob with autogenerated code. A follow-on diff will do the same thing for serializers.

Supporting this required refactoring blob serialization to use the newtype serializer pattern

Once sufficiently developed (and if desired) this would allow us to completely remove our use of Serde-derived serializers with serializers & deserializers generated at codegen time.

Generated code diff: main-generated...generate-deserializers-generated

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This code replaces the hand-written deserializers that were used to serialize types like Instant & Blob with autogenerated code. A follow-on diff will do the same thing for serializers.

Once sufficiently developed (and if desired) this would allow us to completely remove our use of Serde-derived serializers with serializers & deserializers generated at codegen time.
@rcoh rcoh requested a review from a team December 22, 2020 21:36
Copy link

@kggilmer kggilmer left a comment

Choose a reason for hiding this comment

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

LGTM

timestamp, blob
)
}
println("file:///${writer.baseDir}/src/serde_util.rs")

Choose a reason for hiding this comment

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

you need this println for something?

@rcoh
Copy link
Collaborator Author

rcoh commented Dec 30, 2020 via email

@rcoh rcoh merged commit 02d0db5 into main Dec 30, 2020
@rcoh rcoh deleted the generate-deserializers branch December 30, 2020 15:07
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.

2 participants