Skip to main content

PlatformDeserializableFromVersionedStructureTrusted

Trait PlatformDeserializableFromVersionedStructureTrusted 

Source
pub trait PlatformDeserializableFromVersionedStructureTrusted {
    // Required method
    fn versioned_deserialize_trusted(
        data: &[u8],
        platform_version: &PlatformVersion,
    ) -> Result<Self, ProtocolError>
       where Self: Sized;
}
Expand description

We will deserialize a versioned structure into a code structure For example we have DataContractV0 and DataContractV1 The system version will tell which version to deserialize into This happens by first deserializing the data into a potentially versioned structure For example we could have DataContractSerializationFormatV0 and DataContractSerializationFormatV1 Both of the structures will be valid in perpetuity as they are saved into the state. So from the bytes we could get DataContractSerializationFormatV0. Then the system_version given will tell to transform DataContractSerializationFormatV0 into DataContractV1 (if system version is 1)

Trusted twin: bytes this node wrote itself, see PlatformDeserializableTrusted.

Required Methods§

Source

fn versioned_deserialize_trusted( data: &[u8], platform_version: &PlatformVersion, ) -> Result<Self, ProtocolError>
where Self: Sized,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§