near / borsh-rs

Rust implementation of Binary Object Representation Serializer for Hashing
https://borsh.io/
Apache License 2.0
321 stars 67 forks source link

More than 256 enum variants #181

Open mahkoh opened 1 year ago

mahkoh commented 1 year ago

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.

frol commented 1 year ago

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 commented 1 year ago

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