bincode-org / bincode

A binary encoder / decoder implementation in Rust.
MIT License
2.63k stars 265 forks source link

Different int encoding option for integers and enum variant tags #720

Closed lemunozm closed 2 months ago

lemunozm commented 2 months ago

Hi!

Currently, both normal integers and enum tags are handled under the same InternalIntEncodingConfig option. Could that option be divided into two different options? There are a lot of protocols that use fixed ints for "normal" integers but just an u8 for distinguish enum variants (which can be achieved in most cases with the Varint).

Is that change something in mind for this crate?

VictorKoenders commented 2 months ago

Unfortunately Bincode does not have support for other protocols in mind, so this is not within scope of this crate