Skip to main content

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl PlatformSerializableWithPlatformVersion for BasicError

Source§

impl PlatformSerializableWithPlatformVersion for ConsensusError

Source§

impl PlatformSerializableWithPlatformVersion for CreatedDataContract

Source§

impl PlatformSerializableWithPlatformVersion for DataContract

Source§

impl PlatformSerializableWithPlatformVersion for DataContractError

Source§

impl PlatformSerializableWithPlatformVersion for DataTriggerError

Source§

impl PlatformSerializableWithPlatformVersion for DocumentPropertyReferenceTarget

Source§

impl PlatformSerializableWithPlatformVersion for FeeError

Source§

impl PlatformSerializableWithPlatformVersion for JsonSchemaError

Source§

impl PlatformSerializableWithPlatformVersion for MergeIdentityNonceResult

Source§

impl PlatformSerializableWithPlatformVersion for SignatureError

Source§

impl PlatformSerializableWithPlatformVersion for StateError

Source§

impl PlatformSerializableWithPlatformVersion for TokenConfigurationChangeItem

Source§

impl PlatformSerializableWithPlatformVersion for TokenPaymentInfo

Source§

impl PlatformSerializableWithPlatformVersion for TokenPricingSchedule