borsh-rs icon indicating copy to clipboard operation
borsh-rs copied to clipboard

More than 256 enum variants

Open mahkoh opened this issue 11 months ago • 2 comments

I have a usecase where the number of enum variants is not bounded. Is support for more than 256 enum variants going to be added to borsh?

An enum attribute such as #[borsh(repr = u32)] should be sufficient.

mahkoh avatar Jul 15 '23 17:07 mahkoh

So far it is quite a rare case, so I would rather not complicate the code-base. If you need it, feel free to just implement borsh traits explicitly.

I will keep this issue open for several months to collect further feedback and concrete use-cases if it turns out to be popular (I must admit, I doubt it is going to be the case)

frol avatar Jul 15 '23 19:07 frol

@dj8yfo I see several PR referring to this issue. Was it resolved afterall?

frol avatar Oct 03 '23 06:10 frol