-
Notifications
You must be signed in to change notification settings - Fork 65
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
Serialize for Tweet? #90
Comments
Could you outline your use-case? It would not be possible to serialize the tweet in the exact form that it is received from the twitter servers as it is a lossy deserialization. If you just want to dump the tweet e.g. to JSON for storage, I agree |
Yes, storing them in a json format is the use case. Copying the values in a struct is what I'm doing currently, but it would be nice to have a default out of the box, since I guess this use case is quite common. |
I'm hesitant about just deriving Serialize and calling it a day, for the thing @adwhit mentioned - the Serialize and Deserialize implementations wouldn't be symmetric. If you wanted to load the JSON back up into a ...although now that i type that, that does seem like a solution. It would make the deserializer for Tweets much more complicated, since we'd need to make sure that |
I'd also like to have a |
I had an idea on how to do this somewhat efficiently, and posted PR #99 with the implementation. I asked around and people pointed me to |
It seems for Tweet only Deserialize is implemented and not Serialize
https://github.com/egg-mode-rs/egg-mode/blob/master/src/tweet/mod.rs#L236
The text was updated successfully, but these errors were encountered: