Created
December 22, 2017 13:31
-
-
Save IslandUsurper/a9e26a86225b3727189e59bb3af7ef0b to your computer and use it in GitHub Desktop.
Rust and XML schema
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ErrorRecovery> | |
<ListID>1235623425</ListID> | |
<EditSequence>whatever</EditSequence> | |
</ErrorRecovery> | |
<ErrorRecovery> | |
<OwnerID>FOO</OwnerID> | |
</ErrorRecovery> | |
<ErrorRecovery> | |
<TxnID>18302-1488303-random-numbers</TxnId> | |
<TxnNumber>9492023</TxnNumber> | |
</ErrorRecovery> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[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