PlatformSerializableWithPlatformVersion

Trait PlatformSerializableWithPlatformVersion 

Source
pub trait PlatformSerializableWithPlatformVersion {
    type Error;

    // Required method
    fn serialize_to_bytes_with_platform_version(
        &self,
        platform_version: &PlatformVersion,
    ) -> Result<Vec<u8>, Self::Error>;

    // Provided method
    fn serialize_consume_to_bytes_with_platform_version(
        self,
        platform_version: &PlatformVersion,
    ) -> Result<Vec<u8>, Self::Error>
       where Self: Sized { ... }
}

Required Associated Types§

Required Methods§

Source

fn serialize_to_bytes_with_platform_version( &self, platform_version: &PlatformVersion, ) -> Result<Vec<u8>, Self::Error>

Version based serialization is done based on the desired structure version. For example we have DataContractV0 and DataContractV1 for code based Contracts This means objects that will execute code And we would have DataContractSerializationFormatV0 and DataContractSerializationFormatV1 which are the different ways to serialize the concept of a data contract. The data contract would call versioned_serialize. There should be a converted for each Data contract Version towards each DataContractSerializationFormat

Provided Methods§

Source

fn serialize_consume_to_bytes_with_platform_version( self, platform_version: &PlatformVersion, ) -> Result<Vec<u8>, Self::Error>
where Self: Sized,

If the trait is not used just do a simple serialize

Implementors§