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

Let serializers get a type traits struct instead of the raw type. #1542

Merged
merged 5 commits into from
Aug 17, 2016

Conversation

s-ludwig
Copy link
Member

@s-ludwig s-ludwig commented Aug 4, 2016

This is a breaking change for any serializer implementations. The expectation though is that the only existing seriailzer implementations are currently the ones in vibe.d itself.

The traits struct in particular carries UDA information, which allows serializers to support serializer specific UDAs. The code has also been refactored a bit to reduce line length/visual noise.

@s-ludwig s-ludwig force-pushed the traits_based_serializers branch from 33cbe80 to 7c00d71 Compare August 5, 2016 08:55
The traits struct in particular carries UDA information, which allows serializers to support serializer specific UDAs. ***This is a breaking change for any serializer implementations**. The expectation though is that the only existing seriailzer implementations are currently the ones in vibe.d itself.
This enables the deserializer to access field attributes and other useful information.
@s-ludwig s-ludwig force-pushed the traits_based_serializers branch from 7c00d71 to abbf07d Compare August 5, 2016 09:00
@s-ludwig
Copy link
Member Author

s-ludwig commented Aug 5, 2016

Cleaned up the diff and added beginWriteDocument/endWriteDocument, beginReadArrayEntry/endReadArrayEntry and beginReadDictionaryEntry/endReadDictionaryEntry.

@skoppe
Copy link
Contributor

skoppe commented Aug 16, 2016

The changes look pretty straightforward. I see no issues. (btw good idea to separate T => Traits rename)

@s-ludwig
Copy link
Member Author

Thanks for reviewing! I still often do not manage to focus on doing a single thing at a time, so I had to rework the commit history quite heavily to get it to a reviewable state ;-)

BTW, I'll get to #1547 shortly (still in vacation, but maybe tomorrow when we are on the ferry), but it looks like what I had in mind for such an implementation.

@s-ludwig s-ludwig merged commit 50cbbbb into master Aug 17, 2016
@skoppe
Copy link
Contributor

skoppe commented Aug 17, 2016

Hehe, I thought the best way to get your attention would be to review something :)

@s-ludwig s-ludwig deleted the traits_based_serializers branch October 25, 2016 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants