Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upexpose default options and serializers #310
Merged
+455
−265
Conversation
76347f5
to
356452d
|
Servo only relies on official public APIs to my knowledge. |
|
Great to hear! I realized this makes the unwieldy |
VictorKoenders
commented
Apr 1, 2020
|
One of the things I dislike is that a caller has to import both
Note: a lot of crates do this, it seems acceptable to just let this be. |
This was
linked to
issues
Apr 16, 2020
Closed
This was referenced Apr 16, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
ZoeyR commentedMar 19, 2020
•
edited
This is a very early PR that explores if its possible to expose the
SerializerandDeserializerin a way that would allow us to expand options in the future.Basic Design
DefaultOptionsandOptionsExttraits publicly.SerializerandDeserializerpublicly.Compound, OptionsprivateI believe this would allow us to implement any future improvements in a backwards compatible manner.
OptionsExtcan't be implemented by 3rd party crates since it is sealed, so adding new methods should be fine.Remarks
byteordertrait.This enables us to add features to our endian behavior in the future without breaking the public API. e.g. making varint respect the endian choices.
Unanswered Questions
config()API?SerializerAcceptortrait, and does this make that obsolete?Tagging @jdm since (I think?) you would have perspective if servo is using these non-public APIs
Tagging @dtolnay since you had significant input on the current config implementation