kafka-protocol-rs
kafka-protocol-rs copied to clipboard
Code gen Encodable impl on ResponseKind enum
Generating an Encodable impl on the ResponseKind enum would be a nice ergonomics win. All it would do is just match over the response kind, and then call encode on one of the inner branches. NBD, but that is a lot of code which everyone won't have to write if we generate it here.
Yeah, this could be nice for convenience, although in a production setting there are a lot of messages that your implementation likely won't be able to handle (i.e. all the weird internal raft messages), and so there's likely a need for a match with only the messages you implement somewhere in your code base. But this is generally helpful/harmless so would definitely accept a contribution here.
I believe this is closed by https://github.com/tychedelia/kafka-protocol-rs/pull/70