You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an enum with a few variants, and I would like one of them to behave as None would, deserializing to and from it if a null is encountered. Is this possible with serde_derive?
The text was updated successfully, but these errors were encountered:
vidhanio
changed the title
[serde_derive] Is there a way to derive my own "None" variant?
[serde_derive] Is there a way to derive my own "None" variant?
Nov 5, 2022
Take a look at the docs of field attributes: https://serde.rs/field-attrs.html They're very well documented! Maybe default is, what you're looking for.
I have an
enum
with a few variants, and I would like one of them to behave asNone
would, deserializing to and from it if anull
is encountered. Is this possible withserde_derive
?The text was updated successfully, but these errors were encountered: