tokio-rs / bytes

Utilities for working with bytes
MIT License
1.87k stars 278 forks source link

Add protobuf-style variable-length serialization / deserialization #608

Open arnohaase opened 1 year ago

arnohaase commented 1 year ago

Variable-length integer encoding (protobuf style) is present in many network and file protocols. While it is not at the same level of 'standard' as LE / BE encoding, I would find it a highly useful addition to the Buf / BufMut traits.

I'm happy to provide a PR, but I wanted to check if you feel this fits into the crate's scope.

Darksonn commented 1 year ago

My gut feeling is that this is outside of the scope.

arnohaase commented 1 year ago

So - providing a separate crate extending Buf / BufMut functionality would probably be the best way to go?

Darksonn commented 1 year ago

Sure, you can definitely do that.

arnohaase commented 1 year ago

In case you are interested: https://github.com/arnohaase/bytes-varint