Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

Allow trait derivation for tuple-struct style enums #5

Open
kkohbrok opened this issue Aug 9, 2021 · 2 comments
Open

Allow trait derivation for tuple-struct style enums #5

kkohbrok opened this issue Aug 9, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@kkohbrok
Copy link
Member

kkohbrok commented Aug 9, 2021

Unrelated but if you need something to do and want to poke around the tls codec code; This pattern of implementing (de)serialization of enums could be put into the library and would safe us quite some code.

Originally posted by @franziskuskiefer in openmls/openmls#444 (comment)

@kkohbrok
Copy link
Member Author

kkohbrok commented Aug 9, 2021

I have made some progress in terms of understanding the derivation macros. Just to be clear, we want to be able to derive the traits specifically for enums Xyz, where we assume that an additional enum XyzType exists and when serializing Xyz, we prefix the resulting bytes with the correct serialized XyzType (which would allow deserialization afterwards)? Examples for this would be Extension and Credential and Content (i.e. MlsPlaintextContentType).

@franziskuskiefer
Copy link
Contributor

Exactly. I'm not sure if the Type naming is the best (it's just what MLS does). But just decide on what you like best for the name.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants