This repository was archived by the owner on Aug 15, 2025. It is now read-only.
functions to enable encoding/decoding serde types#422
Merged
VictorKoenders merged 3 commits intotrunkfrom Nov 8, 2021
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## trunk #422 +/- ##
==========================================
- Coverage 71.04% 64.62% -6.42%
==========================================
Files 41 47 +6
Lines 2811 3237 +426
==========================================
+ Hits 1997 2092 +95
- Misses 814 1145 +331
Continue to review full report at Codecov.
|
bd7e14b to
1e727ff
Compare
ghost
reviewed
Nov 7, 2021
ghost
left a comment
There was a problem hiding this comment.
I feel like this should have an impl Encode for T where T: Serialize and same for Decode. With the current implementation you can't bring a struct that only implements Serialize into a struct you want to implement Encode on
Contributor
Author
|
I've opened a separate issue for having bincode |
ghost
reviewed
Nov 8, 2021
ghost
approved these changes
Nov 8, 2021
41e04a2 to
e45249f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an initial attempt at supporting serde in bincode 2.
I did have to make separate functions for all serde-related functionality. This is possibly preventable.
Implementing
Serializewas relatively easy.For
DeserializeandDeserializeOwnedI ended up making 2 functions, which supportBorrowDecoderandDecoderrespectfully. These also have 2 separate functions right now, we might be able to merge this into one function.