Serialization involves serializing the type url + value, where the value calls the trait-object's erased_serialize method
Deserialization involves lazily deserializing the value into serde_value in case the type url is present afterwards. Once the type url and generic value are both deserialized, the generic value is deserialized using the deserializer callback found in the corresponding entry found in inventory
Breaking Changes
Due to the amount of breaking changes, this PR requires a major version bump.
Remove prost-wkt-build and introduce prost-wkt-derive, which provides a derive proc-macro which used in combination with message_attribute and enable_type_names will generate impls of the MessageSerde trait for messages generated by prost_build.
Require the use of prost::Name to determine the typeurl of messages (#57). This is breaking as the default impl of the trait leaves the package empty.
Removed unused MessageSerde methods and introduce the as_erased_serialize method, which is used since rust-lang/rust#65991 is still in progress
TODO
Optimize querying the inventory by caching type url calls instead of creating a new string.
Thanks for creating this PR @wtzhang23! It contains quite a few interesting changes. Can you give a short description of the main changes that are implemented?
Motivation
protoc-gen-*
Summary of Changes
Any
typedeserializer
callback found in the corresponding entry found in inventoryBreaking Changes
Due to the amount of breaking changes, this PR requires a major version bump.
prost-wkt-build
and introduceprost-wkt-derive
, which provides a derive proc-macro which used in combination with message_attribute and enable_type_names will generate impls of theMessageSerde
trait for messages generated byprost_build
.MessageSerde
methods and introduce theas_erased_serialize
method, which is used since rust-lang/rust#65991 is still in progressTODO