gir_parser/
attribute.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use xmlserde_derives::XmlDeserialize;

#[derive(Clone, Debug, XmlDeserialize)]
#[xmlserde(root = b"attribute")]
#[xmlserde(deny_unknown_fields)]
pub struct Attribute {
    #[xmlserde(name = b"name", ty = "attr")]
    name: String,
    #[xmlserde(name = b"value", ty = "attr")]
    value: String,
}

impl Attribute {
    pub fn name(&self) -> &str {
        &self.name
    }

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