Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rust and XML schema
<ErrorRecovery>
<ListID>1235623425</ListID>
<EditSequence>whatever</EditSequence>
</ErrorRecovery>
<ErrorRecovery>
<OwnerID>FOO</OwnerID>
</ErrorRecovery>
<ErrorRecovery>
<TxnID>18302-1488303-random-numbers</TxnId>
<TxnNumber>9492023</TxnNumber>
</ErrorRecovery>
<xsd:element name="ErrorRecovery">
<xsd:complexType>
<xsd:sequence>
<xsd:choice>
<xsd:element ref="ListID" minOccurs="0"/>
<xsd:element ref="OwnerID" minOccurs="0"/>
<xsd:element ref="TxnID" minOccurs="0"/>
</xsd:choice>
<xsd:element ref="TxnNumber" minOccurs="0"/>
<xsd:element name="EditSequence" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="STRTYPE">
<xsd:maxLength value="16"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element ref="ExternalGUID" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
#[derive(Debug, Deserialize)]
pub struct ErrorRecovery {
pub _id: Option<ErrorRecoveryID>,
pub txn_number: Option<i64>,
pub edit_sequence: Option<String>,
#[serde(rename = "ExternalGUID")]
pub external_guid: Option<String>,
}
#[derive(Debug, Deserialize)]
pub enum ErrorRecoveryId {
ListID(String),
OwnerID(String),
TxnID(String),
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.