OxL Справочник OxL
РусскийEnglish

method SchemaCompat.roundtrip

New writer -> old reader -> old writer -> new reader (D-7071).

Example:

oxl✓ проверяется в CI
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

См. также