kafka-protocol-rs icon indicating copy to clipboard operation
kafka-protocol-rs copied to clipboard

Code gen Encodable impl on ResponseKind enum

Open thedodd opened this issue 1 year ago • 1 comments

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.

thedodd avatar Jan 11 '24 22:01 thedodd

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.

tychedelia avatar Jan 13 '24 17:01 tychedelia

I believe this is closed by https://github.com/tychedelia/kafka-protocol-rs/pull/70

rukai avatar Sep 03 '24 22:09 rukai