While implementing an extension for instant-epp I would like to parse
<changePoll:caseId name="other" type="custom">urs123</changePoll:caseId>
into the following ergonomic Rust representation
#[derive(Debug, FromXml, ToXml)]
#[xml(rename = "caseId", ns(XMLNS))]
pub struct CaseIdentifier<'a> {
#[xml(attribute, rename = "type")]
pub id_type: CaseIdentifierType,
#[xml(direct)]
pub id: Cow<'a, str>,
}
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum CaseIdentifierType<'a> {
Udrp,
Urs,
Custom(&'a str),
}
It would be nice if CaseIdentifierType can take a #[from_attribute("name")] or similar to generate code that lets CaseIdentifierType consume an attribute node of the parent element node.
While implementing an extension for instant-epp I would like to parse
into the following ergonomic Rust representation
It would be nice if CaseIdentifierType can take a
#[from_attribute("name")]or similar to generate code that lets CaseIdentifierType consume an attribute node of the parent element node.