You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question and I hope this is right channel to ask. I am trying to deserialize a data format based
on XML using serde, which essentially boils down to
Note how the B tag can be used a shorthand for item kind="B".
I have a working implemention for the non-shorthand part that looks like this
// These have more inner structure, omitted for brevity#[deriving(Deserialize)]structKind{ ... }#[deriving(Deserialize)]structItem{ ... }#[deriving(Deserialize)]enumRootBody{Item(Item),Kind(Kind),}#[deriving(Deserialize)]structRoot{#[serde(rename="$value")]body:Vec<RootBody>,}
However, how to capture the short-hand feature? Using the pattern from the
JSON examples
I have a question and I hope this is right channel to ask. I am trying to deserialize a data format based
on XML using serde, which essentially boils down to
Note how the
B
tag can be used a shorthand foritem kind="B"
.I have a working implemention for the non-shorthand part that looks like this
However, how to capture the short-hand feature? Using the pattern from the
JSON examples
fails with
Custom("missing field $value")'
. I have also trieddeserialize-enum-str
andhad no success.
The text was updated successfully, but these errors were encountered: