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

Dynamic structs #48

Merged
merged 5 commits into from
Dec 4, 2024
Merged

Dynamic structs #48

merged 5 commits into from
Dec 4, 2024

Conversation

einarmo
Copy link
Owner

@einarmo einarmo commented Dec 4, 2024

Support for serializing and deserializing structs using just the DataTypeDefinition and encoding IDs.

This is an essential feature for creating generic clients, but it is not trivial. The current solution is actually far more powerful than what codegen is capable of. We might want to think about expanding the macros to support structures with optional fields and unions, but that can come later.

This is a really powerful feature that allows you to use the type
definition to encode and decode structs into a vec of variants. This
should with a little more work make it possible to create a client that
can read from any server without needing codegen for the types on that
server.
They really do fit better there, even if they are primarily useful for
the client.
Clippy broke it, actually...
@einarmo einarmo merged commit 1c0dbb3 into rewrite-master Dec 4, 2024
5 checks passed
@einarmo einarmo deleted the dynamic-structs branch December 4, 2024 12:16
einarmo added a commit that referenced this pull request Dec 15, 2024
Support for serializing and deserializing structs using just the DataTypeDefinition and encoding IDs.

This is an essential feature for creating generic clients, but it is not trivial. The current solution is actually far more powerful than what codegen is capable of. We might want to think about expanding the macros to support structures with optional fields and unions, but that can come later.
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.

1 participant