-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add serialization deserialization #43
Add serialization deserialization #43
Conversation
I made load generic. |
Sorry about making so many commits, but this is ready for review. |
Thanks for the work here; I haven't had a chance to do a proper review, so just touching this to let you know I've seen it and hope to have a chance to look it over soon. |
Okay thanks. no rush. |
The original implementation of `cookie_store` provided convenience methods for saving/loading via JSON. The output format is not valid JSON, however; `serde::json` introduces proper support. The legacy implementation is retained alongside the new functionality; we provide guidance on the difference via documentation.
I had some time to review this. I did a bit of a refactor; I introduced I also dropped the intermediate Finally, as commented before, I don't want to fully remove the existing LMK if this is still in line with the functionality you were intending. |
Yeah, it's good! Thanks for your work. |
This is the general idea. I can make load generic like I did with save. With a struct that implements Serialize and Deserialize it is easy to add other implementations besides JSON. I am partial to RON, and you mentioned a curl cookie format. Let me know what you think and what I have to change to get this included, along with what tests you expect.
I didn't reuse more code than I did, because the old code was line oriented, but this Serializes and Deserializes the whole blob at once.
I am creating a pull request, but I expect some work to be done before a merge happens.