orium / rpds

Rust persistent data structures
Mozilla Public License 2.0
1.28k stars 58 forks source link

Add optional Serde support #1

Closed dtolnay closed 6 years ago

dtolnay commented 6 years ago

In #rust today someone was struggling to serialize rpds::Vector (logs). It would be great to have Serde impls for these data structures that can be enabled by a serde cfg.

orium commented 6 years ago

In the next few days I will probably not be able to get any coding done, but once I'm I will work on it. (Meanwhile if someone wants to work on a PR I might be able to review/merge it.)

idupree commented 6 years ago

I started implementing this in https://github.com/idupree/rpds/commits/serde-impls -- does it look reasonable so far?

dtolnay commented 6 years ago

Looks good so far!

orium commented 6 years ago

Yup, looks good. I only have some cosmetic/organization suggestions but I will leave that to the PR.

idupree commented 6 years ago

Might I have your cosmetic suggestions now so that I don't have to redo cosmetic changes for every data structure?

idupree commented 6 years ago

(I could send it in a provisional pull request if it's easier to comment on that way)

idupree commented 6 years ago

Implemented all of them (Vector, List, Queue, Stack, RedBlackTreeSet, HashTrieSet, RedBlackTrieMap, HashTrieMap). Note in case you had pulled the initial commit series: I've git-rebased since then. Pull request: https://github.com/orium/rpds/pull/2

orium commented 6 years ago

Closed by #4