birkenfeld / serde-pickle

Rust (de)serialization for the Python pickle format.
Apache License 2.0
188 stars 28 forks source link

Added support for builtin list. #16

Closed jeroenbakker-atmind closed 3 years ago

jeroenbakker-atmind commented 3 years ago

Reset memoize to support streaming multiple objects.

By default (value_)from_reader closes the input stream. It is possible to deserialize multiple pickle objects from a single stream by implementing a custom reader.

This patch will reset the memoize at the beginning when a new object is deserialized. Any refs would then point to the correct object inside the memoize.

We checked several approaches but this approach seems to fit best (support most protocols) however this might not be the obvious place.

birkenfeld commented 3 years ago

Nightly failure is due to https://github.com/rust-num/num-bigint/issues/218

birkenfeld commented 3 years ago

Thanks for the PR! I've released 0.6.3 with the fix.