Trait serde_roundtrip::SameDeserialization [] [src]

pub trait SameDeserialization: Deserialize {
    type SameAs: Deserialize;
    fn from(data: Self::SameAs) -> Self;
}

This is a helper trait used by RoundTrip implementations, which specifies that two deserializations are compatible.

If T: SameDeserialization then the deserialization format of T is compatible with the deserialization format of T::SameAs.

Associated Types

The type that has the same deserialization.

Required Methods

This function specifies the behaviour of deserialization. If T: SameDeserialization then deserializing at type T should produce the same result as deserializing at type T::SameAs then calling T::from.

Implementors