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

Add serde support for protobuf generated struct. #35

Merged
merged 3 commits into from
Jul 23, 2022

Conversation

jmjoy
Copy link
Member

@jmjoy jmjoy commented Jul 23, 2022

So protobuf generated struct can be serialized and deserialized.

@@ -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"] }
Copy link
Member Author

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-commenter
Copy link

Codecov Report

Merging #35 (5f97bfd) into master (b5ac538) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #35   +/-   ##
=======================================
  Coverage   38.88%   38.88%           
=======================================
  Files          13       13           
  Lines         306      306           
=======================================
  Hits          119      119           
  Misses        187      187           
Impacted Files Coverage Δ
src/skywalking_proto/v3/mod.rs 0.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.

Copy link
Member

@wu-sheng wu-sheng left a 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?

@wu-sheng wu-sheng added this to the 0.4.0 milestone Jul 23, 2022
@jmjoy
Copy link
Member Author

jmjoy commented Jul 23, 2022

Curious question, how we do serialization now?

The protobuf library use it's own trait prost::Message, not the most common serialize/deserialize library serde.

@wu-sheng
Copy link
Member

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?

@jmjoy
Copy link
Member Author

jmjoy commented Jul 23, 2022

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 serde.

@wu-sheng wu-sheng merged commit 9f777ed into apache:master Jul 23, 2022
@jmjoy jmjoy deleted the serde branch July 23, 2022 02:58
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.

3 participants