Derive Serialize, Deserialize on data structures #62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Trevor,
I was writing a small program using your crate and found that I could not easily "serde" the event data to JSON. There are ways around this but that would be a lot of work - it would be much more convenient for me if the
Serialize
andDeserialize
traits were already on the types in your crate.Turns out the Rust API guidelines recommend that authors implement the serde
Serialize
andDeserialize
traits on all data structures, presumably for this sort of reason.I went ahead and derived
Serialize
andDeserialize
on all data structures I could find, given the fact that you useserde
anyway. One notable exception is theEvent
enum, it didn't seem like enough of a data structure to me.Also (this is in the same link above) they recommend a specific way to pull in
serde
andserde_json
, I went ahead and put that in Cargo.toml. All unit tests still pass.Don't hesitate to let me know if you'd like me to change anything in this PR, I'd be happy to. Thanks for your time!
Toon