1
Fork 0

Serialize all enums as externally tagged to guarantee compatibility with binary formats such as bincode or postcard

This commit is contained in:
Luca Palmieri 2023-05-22 18:17:52 +01:00
parent 48ec50ae39
commit a5e5101375
96 changed files with 703 additions and 715 deletions

View file

@ -8,19 +8,19 @@
pub trait Loud {}
// @set very_loud_id = "$.index[*][?(@.name=='VeryLoud')].id"
// @count "$.index[*][?(@.name=='VeryLoud')].inner.bounds[*]" 1
// @is "$.index[*][?(@.name=='VeryLoud')].inner.bounds[0].trait_bound.trait.id" $loud_id
// @count "$.index[*][?(@.name=='VeryLoud')].inner.trait.bounds[*]" 1
// @is "$.index[*][?(@.name=='VeryLoud')].inner.trait.bounds[0].trait_bound.trait.id" $loud_id
pub trait VeryLoud: Loud {}
// @set sounds_good_id = "$.index[*][?(@.name=='SoundsGood')].id"
pub trait SoundsGood {}
// @count "$.index[*][?(@.name=='MetalBand')].inner.bounds[*]" 2
// @is "$.index[*][?(@.name=='MetalBand')].inner.bounds[0].trait_bound.trait.id" $very_loud_id
// @is "$.index[*][?(@.name=='MetalBand')].inner.bounds[1].trait_bound.trait.id" $sounds_good_id
// @count "$.index[*][?(@.name=='MetalBand')].inner.trait.bounds[*]" 2
// @is "$.index[*][?(@.name=='MetalBand')].inner.trait.bounds[0].trait_bound.trait.id" $very_loud_id
// @is "$.index[*][?(@.name=='MetalBand')].inner.trait.bounds[1].trait_bound.trait.id" $sounds_good_id
pub trait MetalBand: VeryLoud + SoundsGood {}
// @count "$.index[*][?(@.name=='DnabLatem')].inner.bounds[*]" 2
// @is "$.index[*][?(@.name=='DnabLatem')].inner.bounds[1].trait_bound.trait.id" $very_loud_id
// @is "$.index[*][?(@.name=='DnabLatem')].inner.bounds[0].trait_bound.trait.id" $sounds_good_id
// @count "$.index[*][?(@.name=='DnabLatem')].inner.trait.bounds[*]" 2
// @is "$.index[*][?(@.name=='DnabLatem')].inner.trait.bounds[1].trait_bound.trait.id" $very_loud_id
// @is "$.index[*][?(@.name=='DnabLatem')].inner.trait.bounds[0].trait_bound.trait.id" $sounds_good_id
pub trait DnabLatem: SoundsGood + VeryLoud {}