1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
use xmlserde_derives::XmlDeserialize;

#[derive(Clone, Debug, XmlDeserialize)]
#[xmlserde(root = b"source-position")]
#[xmlserde(deny_unknown_fields)]
pub struct SourcePosition {
    #[xmlserde(name = b"filename", ty = "attr")]
    filename: String,
    #[xmlserde(name = b"line", ty = "attr")]
    line: String,
    #[xmlserde(name = b"column", ty = "attr")]
    column: Option<String>,
}

impl SourcePosition {
    pub fn filename(&self) -> &str {
        &self.filename
    }

    pub fn line(&self) -> &str {
        &self.line
    }

    pub fn column(&self) -> Option<&str> {
        self.column.as_deref()
    }
}

#[derive(Clone, Debug, XmlDeserialize)]
#[xmlserde(root = b"doc-deprecated")]
#[xmlserde(deny_unknown_fields)]
pub struct DocDeprecated {
    #[xmlserde(name = b"xml:space", ty = "attr")]
    space: Option<String>,
    #[xmlserde(name = b"xml:whitespace", ty = "attr")]
    whitespace: Option<String>,
    #[xmlserde(ty = "text")]
    text: String,
}

impl DocDeprecated {
    pub fn space(&self) -> Option<&str> {
        self.space.as_deref()
    }

    pub fn whitespace(&self) -> Option<&str> {
        self.whitespace.as_deref()
    }

    pub fn text(&self) -> &str {
        &self.text
    }
}

#[derive(Clone, Debug, XmlDeserialize)]
#[xmlserde(root = b"doc-stability")]
#[xmlserde(deny_unknown_fields)]
pub struct DocStability {
    #[xmlserde(name = b"xml:space", ty = "attr")]
    space: Option<String>,
    #[xmlserde(name = b"xml:whitespace", ty = "attr")]
    whitespace: Option<String>,
    #[xmlserde(ty = "text")]
    text: String,
}

impl DocStability {
    pub fn space(&self) -> Option<&str> {
        self.space.as_deref()
    }

    pub fn whitespace(&self) -> Option<&str> {
        self.whitespace.as_deref()
    }

    pub fn text(&self) -> &str {
        &self.text
    }
}

#[derive(Clone, Debug, XmlDeserialize)]
#[xmlserde(root = b"doc-version")]
#[xmlserde(deny_unknown_fields)]
pub struct DocVersion {
    #[xmlserde(name = b"xml:space", ty = "attr")]
    space: Option<String>,
    #[xmlserde(name = b"xml:whitespace", ty = "attr")]
    whitespace: Option<String>,
    #[xmlserde(ty = "text")]
    text: String,
}

impl DocVersion {
    pub fn space(&self) -> Option<&str> {
        self.space.as_deref()
    }

    pub fn whitespace(&self) -> Option<&str> {
        self.whitespace.as_deref()
    }

    pub fn text(&self) -> &str {
        &self.text
    }
}

#[derive(Clone, Debug, XmlDeserialize)]
#[xmlserde(root = b"doc")]
#[xmlserde(deny_unknown_fields)]
pub struct Documentation {
    #[xmlserde(name = b"xml:space", ty = "attr")]
    space: Option<String>,
    #[xmlserde(name = b"xml:whitespace", ty = "attr")]
    whitespace: Option<String>,
    #[xmlserde(name = b"filename", ty = "attr")]
    filename: Option<String>,
    #[xmlserde(name = b"line", ty = "attr")]
    line: Option<String>,
    #[xmlserde(name = b"column", ty = "attr")]
    column: Option<String>,
    #[xmlserde(ty = "text")]
    text: String,
}

impl Documentation {
    pub fn space(&self) -> Option<&str> {
        self.space.as_deref()
    }

    pub fn whitespace(&self) -> Option<&str> {
        self.whitespace.as_deref()
    }

    pub fn filename(&self) -> Option<&str> {
        self.filename.as_deref()
    }

    pub fn line(&self) -> Option<&str> {
        self.line.as_deref()
    }

    pub fn column(&self) -> Option<&str> {
        self.column.as_deref()
    }

    pub fn text(&self) -> &str {
        &self.text
    }
}