-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add serde support for protobuf generated struct. #35
Conversation
@@ -44,6 +44,7 @@ futures-core = "0.3.21" | |||
futures-util = "0.3.21" | |||
prost = "0.10.4" | |||
prost-derive = "0.10.1" | |||
serde = { version = "1.0.138", features = ["derive"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will be a new dependency serde_derive, it's under MIT OR Apache-2.0 license, so it's OK.
Codecov Report
@@ Coverage Diff @@
## master #35 +/- ##
=======================================
Coverage 38.88% 38.88%
=======================================
Files 13 13
Lines 306 306
=======================================
Hits 119 119
Misses 187 187
Help us with your feedback. Take ten seconds to tell us how you rate us. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious question, how we do serialization now?
The protobuf library use it's own trait prost::Message, not the most common serialize/deserialize library |
I see. So, the serialization would change to use serde automatically after this change, we don't need explicitly calling the method, it is integrated into generated codes. Am I right? |
Yes, for the serialization scenes which need |
So protobuf generated struct can be serialized and deserialized.