It seems pretty un-usable compared to union with a dedicated key attribute (which type are deduced from key by the editor with if and switch statement).
Any idea to enforce Adjacently tag as wasm_typescript_definition does without using serde(tag = "t", content = "c"?
For the moment i am using a factory to turn the initial struct to another that allow the serde macro.
Trying to send decoded postcard to js.
Postcard prevent serde to configure enum representation with macro like
#[serde(tag = "t", content = "c")]
, crashing with a WontSupport error.The default variant enum then export as:
It seems pretty un-usable compared to union with a dedicated key attribute (which type are deduced from key by the editor with if and switch statement).
Any idea to enforce Adjacently tag as wasm_typescript_definition does without using
serde(tag = "t", content = "c"
?For the moment i am using a factory to turn the initial struct to another that allow the serde macro.