Open codingatc opened 1 year ago
I am processing the following file. https://github.com/KhronosGroup/OpenGL-Registry/blob/main/xml/gl.xml
It has lines such as this:
<proto><ptype>GLVULKANPROCNV</ptype> <name>glGetVkProcAddrNV</name></proto> <proto>void <name>glWaitVkSemaphoreNV</name></proto>
So I would like to sometimes extract the string under proto, or the ptype, but always get the name, as it is always present. However:
#[derive(Debug, Deserialize, PartialEq)] struct Proto { #[serde(rename = "$value")] return_type: String, ptype: Option<String>, name: String, }
Doesn't work. Is there a way to state that return_type should only have the non-fields of the xml member proto?
return_type
proto
I am processing the following file. https://github.com/KhronosGroup/OpenGL-Registry/blob/main/xml/gl.xml
It has lines such as this:
So I would like to sometimes extract the string under proto, or the ptype, but always get the name, as it is always present. However:
Doesn't work. Is there a way to state that
return_type
should only have the non-fields of the xml memberproto
?