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) -> TС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
x | &T |
Возвращает
T
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/testing.oxl:397