method SchemaCompat.roundtrip
New writer -> old reader -> old writer -> new reader (D-7071).
Example:
data Person {
id: i64
name: str
}
test contract "roundtrip through the published schema" with schema(old: "published") as old {
assert_eq(old.roundtrip(Person{ id: 2, name: "bob" }).id, 2)
}pub(api) fn roundtrip<T: Serializable>(x: &T) -> TSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
x | &T |
Returns
T
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/testing.oxl:397