-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Splitting serialization2 into a serializer and deserializer trait #3620
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
Conversation
@nikomatsakis Can you review this? |
My impresions: this code looks good, though I think it'd be best if (eventually, perhaps not as part of this pull request) |
I just realized there's a bug. Auto-deserializing a struct still uses |
OK. I tried rebasing this onto incoming and got some merge conflicts. |
Added in my fix, and prepped (but haven't finished yet) support for |
I'll look at this. |
This matches the str::raw function.
Updated to add |
Thanks. |
test wasm32-wasip2 instead of the deprecated wasm32-wasi target
Some types don't make sense to deserialize, such as
&str
types. This patch movesdeserialize
out ofSerializable
into it's own trait, and adds support for the following types:It also adds an explicit
emit_struct
andread_struct
that passes along the struct name to the Serializer/Deserializer.It doesn't yet include the "pass-the-serializer-in-a-a-trait-typarm" that @nikomatsakis and I were talking about in IRC, as that seems to trip over an ICE.
It also includes a small patch that renames
vec::raw::from_slice
intovec::raw::buf_as_slice
, which matchesstr::raw::buf_as_slice
and a small bit of cleanup.