Allow trait derivation for tuple-struct style enums
Opened this issue · 2 comments
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)
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
).
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.