serde-rs / bytes

Wrapper types to enable optimized handling of &[u8] and Vec<u8>
Apache License 2.0
317 stars 37 forks source link

[Help] Serializer/Deserializer for type using variable length encoding scheme #4

Closed kamyuentse closed 7 years ago

kamyuentse commented 7 years ago

For example, I hava a strcut defined as follow:

pub struct VariableLength(u32);

And the field using a variable length encoding scheme, how can I implement Serializer/Deserializer for it?

VaribaleLength <---> Vec<u8>/&[u8]

Thanks a lot.

dtolnay commented 7 years ago

I moved this to https://github.com/serde-rs/serde/issues/1007 because I don't think it will involve serde_bytes.