Expand description
The serializer::Serializer and serializer::Deserializer traits and their implementations.
Structs§
- Serializable
- Wrapper that routes Borsh serialization of the inner value through the
Serializer/Deserializertraits, enabling custom metadata while preventing direct Borsh serialization of the wrapped type.
Traits§
- Deserializer
- Counterpart to
Serializerthat reconstructs a value from its custom serialized representation, complementing theSerializablewrapper. - DeserializerT
- Blanket marker trait for any
Deserializerthat is alsoSendandSync. - Serializer
Serializeris a trait that allows for data serialization and deserialization similar to Borsh, but via a separate trait. This allows for serialization of additional metadata while using underlying Borsh primitives. For example: a struct can implement both Borsh and Serializer traits where Serializer can store custom metadata (e.g. struct version) and then store the struct using Borsh. BothSerializerand Borsh are almost identical, whereSerializeris meant to signal intent for custom serialization.Serializeris a complimentary trait forSerializablestruct and can be used to prevent direct Borsh serialization of a struct.- SerializerT
- Blanket marker trait for any
Serializerthat is alsoSendandSync.