In Serde serializers, how to add an additional field:
#[derive(Serialize)]
struct X {
a: u32,
b: u32,
c: u32,
}
I want to add to JSON serialization field d
with value "qwe"
. How without writing completely a serializer for X
from scratch?
"qwe"
, but value ofc
in hexadecimal? (that's more similar to my real task) – Julianejuliann