Skip to main content

windows_metadata/
lib.rs

1#![doc = include_str!("../readme.md")]
2#![expect(non_snake_case, non_upper_case_globals)]
3#![allow(missing_docs)]
4
5use std::cmp::Ordering;
6use std::collections::*;
7
8mod attributes;
9pub mod reader;
10mod value;
11pub mod writer;
12
13pub use attributes::*;
14pub use value::*;
15mod bindings;
16use bindings::*;
17
18mod clr;
19use clr::*;
20
21mod ty;
22pub use ty::*;
23
24mod type_name;
25pub use type_name::*;
26
27mod signature;
28pub use signature::*;
29
30pub use reader::{AsRow, HasAttributes};
31
32/// Metadata merge and namespace remapping support.
33pub mod merge;
34
35/// Creates a builder for combining winmd files.
36pub fn merge() -> merge::Merger {
37    merge::Merger::new()
38}
39
40/// Creates a [`merge::Remapper`] that rewrites a flat winmd into a header-based namespace
41/// partition for `--package` generation.
42pub fn remap() -> merge::Remapper {
43    merge::Remapper::new()
44}
45
46/// Removes the generic arity suffix beginning with a backtick.
47pub fn trim_tick(name: &str) -> &str {
48    if let Some(pos) = name.find('`') {
49        &name[..pos]
50    } else {
51        name
52    }
53}