Splitting serialization2 into a serializer and deserializer trait#3620
Splitting serialization2 into a serializer and deserializer trait#3620erickt wants to merge 8 commits intorust-lang:incomingfrom
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
&strtypes. This patch movesdeserializeout ofSerializableinto it's own trait, and adds support for the following types:It also adds an explicit
emit_structandread_structthat 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_sliceintovec::raw::buf_as_slice, which matchesstr::raw::buf_as_sliceand a small bit of cleanup.