bincode-org / bincode

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

Trying to implement Decode and Encode on an ArrayVec from tinyvec! #659

Closed iantbutler01 closed 1 year ago

iantbutler01 commented 1 year ago

Hey there, so ArrayVec is a fixed size vector backed by an Array. I'm trying to write an encoder/decoder for it but it looks like, bincode::de::decode_slice_len is a private function. I was hoping I could basically lift the vector encode/decode implementation here in bincode alloc, but it doesn't seem like I'll be able to!

It would be fine in the decode impl to retrieve an intermediate array and pass that to the ArrayVec constructor since for encoding I'll probably be extracting the underlying array and encoding it directly. Hopefully you all can point me in the right direction!

Anyway neat library, great speed and much simpler interface compared to other libraries in the same space.