windows-metadata

Crates.iowindows-metadata
lib.rswindows-metadata
version0.58.0
sourcesrc
created_at2022-01-27 21:09:00.603126
updated_at2024-07-03 19:44:42.717233
descriptionWindows metadata reader
homepage
repositoryhttps://github.com/microsoft/windows-rs
max_upload_size
id522755
size105,890
Kenny Kerr (kennykerr)

documentation

README

Windows metadata reader

The windows-metadata crate provides a fast reader for Windows metadata files based on the ECMA-335 file format.

Start by adding the following to your Cargo.toml file:

[dependencies.windows-metadata]
version = "0.58"

Read metadata as needed:

use windows_metadata::*;

fn main() {
    let bytes = std::fs::read(r#"C:\Windows\System32\WinMetadata\Windows.Foundation.winmd"#)
        .expect("File not found");

    let file = File::new(bytes).expect("Invalid metadata");

    let reader = Reader::new(vec![file]);

    for def in reader.get_type_def("Windows.Foundation", "IAsyncInfo") {
        println!("{}", def.name());

        for method in def.methods() {
            println!("{}", method.name());
        }
    }
}
Commit count: 1451

cargo fmt