Is there a way to add a method value to the serialization output of serde when the struct gets Serialize ? I am looking for something like a "virtual field".
I know that I can define my own Serializer / Visitor or use serde_json::builder to get Value , I just wanted to check first if there was any way to do this using serde_macro magic.
To be clear, I want something like this:
#[derive(Serialize, Deserialize, Debug)] struct Foo { bar: String, #[serde(call="Foo::baz")] baz: i32
source share