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

feat(serde-config)[proto]: Message is not deriving Serialize/Deserialize #2511

Open
ArjixWasTaken opened this issue Oct 16, 2024 · 5 comments · May be fixed by #2544
Open

feat(serde-config)[proto]: Message is not deriving Serialize/Deserialize #2511

ArjixWasTaken opened this issue Oct 16, 2024 · 5 comments · May be fixed by #2544

Comments

@ArjixWasTaken
Copy link

About

One would expect having the feature serde-config enabled, would make all important structs be serializable/deserializable.
Sadly that is not the reality, the following types do not derive the needed macros.

  • Message
  • Header
  • Edns
  • Query
  • MessageType
  • OpCode
  • ResponseCode

Reproduction

Attempt to serialize a Message using serde.

Expected behavior

For serde to be able to serialize Message.

Version:

Crate: proto
Version: 0.24.1

@ArjixWasTaken
Copy link
Author

ArjixWasTaken commented Oct 16, 2024

For now I can sort-off go around this issue by having a 1:1 clone of those structs, and implement conversion functions.
It ain't pretty
image

--

image

@djc
Copy link
Member

djc commented Oct 16, 2024

Well, these types really don't fit the mold of -config specifically. Perhaps we should generalize to a serde flag more broadly, but your use case seems pretty niche.

@ArjixWasTaken
Copy link
Author

ArjixWasTaken commented Oct 16, 2024

Could you entertain me as to what the postfix -config means in the project?

@djc
Copy link
Member

djc commented Oct 16, 2024

AIUI serde-config is mainly used to enable TOML configuration in the main hickory-dns binary crate.

@ArjixWasTaken
Copy link
Author

I see, that makes a lot of sense.
A general serde feature would be nice to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants