-
Notifications
You must be signed in to change notification settings - Fork 68
Newtype, variants and unit #25
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
Newtype, variants and unit #25
Conversation
ser:
* Added newtype serialization (as underlying value)
* Added newtype_variant serialization (as object)
* Added unit serialization (as null)
der:
* Added unit de
* Added newtype_struct
* Implement VariantAccess for non unit enums * Add newtype_variant & struct_variant deserialization * Basic tests for both * Remove Unreachable impl for SerializationStructVariant
8ea4005 to
36cd0ce
Compare
|
+1 on this! Did a test yesterday, and it also fixes support for externally tagged enums (https://serde.rs/enum-representations.html) Good job! |
|
Ping @japaric |
eldruin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| impl<'a, B> ser::SerializeStructVariant for SerializeStructVariant<'a, B> | ||
| where | ||
| B: ArrayLength<u8>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be adapted once #36 lands
|
@MathiasKoch how do you want to go about this one? |
|
Sure thing, give me 5 minutes. Will try to fix the CI clippy stuff at the same time. |
Adds ser/de for the following types:
unittypes, i.e()&struct Test;newtypestructs, ser/de'ing the underlying valuenewtype_variantformat, i.eVariant(u32)struct_variantformat, i.eVariant { x: u32, y: u16 }