Given the structs like:
struct Common {
field_a: String,
field_b: String,
field_c: String
}
#[derive(Encode)]
struct Metric1 {
unique_field: String
#[flatten]
common: Common
}
#[derive(Encode)]
struct Metric2 {
unique_field_2: String
#[serde(flatten)]
common: Common
}
I want the resulting metrics:
metric1{field_a="foo", field_b="bar", field_c="baz",unique_field="something"}
metric2{field_a="foo", field_b="bar", field_c="baz",unique_field_2="something_else"}
(Note: in real world Common and the number of metrics are much larger)
This would match the semantics of serde(flatten)
See #105 (comment) for more discussion