gnzlbg / slice_deque

A contiguous-in-memory double-ended queue that derefs into a slice
https://docs.rs/crate/slice-deque/
Other
154 stars 21 forks source link

Support fo serde #71

Open mjos opened 5 years ago

mjos commented 5 years ago

Hi,

Is it possible to add support for serialization and deserialization via serde derive? Serialization is briefly mentioned in Readme, but otherwise no examples given. Thanks a lot.

gnzlbg commented 5 years ago

We could add that via a cargo feature. SliceDeque derefs into a slice, so implementing this should be a one liner, since serde supports serializing and deserializing slices.

mjos commented 5 years ago

That would be great! Being a beginner I failed to implement custom deserializer (serializer was easier) for external type today, so I reverted to VecDeque for now.

gnzlbg commented 5 years ago

There is a PR open to close this in #72 . Once that is merged I'll release 0.2.5 with this. To enable serde support you'll need to enable the serde cargo feature.

mjos commented 5 years ago

Thanks! And I learned something.