gir_parser/
attribute.rs

1use xmlserde_derives::XmlDeserialize;
2
3#[derive(Clone, Debug, XmlDeserialize)]
4#[xmlserde(root = b"attribute")]
5#[xmlserde(deny_unknown_fields)]
6pub struct Attribute {
7    #[xmlserde(name = b"name", ty = "attr")]
8    name: String,
9    #[xmlserde(name = b"value", ty = "attr")]
10    value: String,
11}
12
13impl Attribute {
14    pub fn name(&self) -> &str {
15        &self.name
16    }
17
18    pub fn value(&self) -> &str {
19        &self.value
20    }
21}