Add enum RawKind and is_* to RawValue#1223
Conversation
8018a9a to
d09c5fa
Compare
|
(This is just an idea from a drive-by user though; would be good to wait for the opinion of the maintainer before acting on this.) |
Hi @Marcono1234, thanks for your comment. I don't see the benefit in merging the Merging the
Why do you think |
|
Ah sorry, I did not mean merging
Because Though as mentioned above, would be good to wait for the opinion of the maintainer on this. |
I mentioned the proc-macro based JSON processor I'm using in PR #1221. This processor ultimately converts the JSON to a Deserializable Rust struct. While converting, it has specialized null handling and custom
Errors for missing fields and such.To accomplish this I currently use an extension trait to provide methods that report what JSON kind (null, bool, string, etc) the
RawValuecontains and a set of tests to assert the invariants of aRawValue. Invariants such as:RawValuehas whitespace stripped during deserializationRawValue.I think knowing the type of a
RawValuecan be useful to all users ofserde_json.What do you think?