windows_gen 0.24.0

Code gen support for the windows crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::*;

#[derive(Clone, PartialEq, Default)]
pub struct PropertyKey {
    pub fmtid: GUID,
    pub pid: u32,
}

impl PropertyKey {
    pub fn from_attributes<I: IntoIterator<Item = Attribute>>(attributes: I) -> Option<Self> {
        attributes.into_iter().find(|attribute| attribute.name() == "PropertyKeyAttribute").map(|attribute| {
            let args = attribute.args();
            Self { fmtid: GUID::from_args(&args), pid: args[11].1.unwrap_u32() }
        })
    }
}