Trait serde_roundtrip::RoundTrip [] [src]

pub trait RoundTrip<Target: Deserialize>: Serialize {
    fn round_trip(&self) -> Target;
}

This trait specifies when it's OK to perform a serialize-then-deserialiize round trip

If S: RoundTrip<T> then the serialization format of S is compatible with the deserialization format of T.

Required Methods

This function specifies the behaviour of a round-trip. If S: RoundTrip<T> then serializing data:S and then deserializing it at type T should produce the same result as Ok(data.round_trip()).

Implementors