Skip to main content

windows_metadata/reader/tables/
mod.rs

1use super::*;
2
3mod assembly_ref;
4mod attribute;
5mod class_layout;
6mod constant;
7mod field;
8mod generic_param;
9mod impl_map;
10mod interface_impl;
11mod member_ref;
12mod method_def;
13mod method_param;
14mod module;
15mod module_ref;
16mod nested_class;
17mod type_def;
18mod type_ref;
19mod type_spec;
20
21pub use method_def::{MethodParamMap, MethodParamSequenceError};
22pub use method_param::{BufferRelationship, ParamDirection};
23
24macro_rules! tables {
25    ($(($name:ident, $table:literal))+) => {
26        $(
27        #[derive(Copy, Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
28        pub struct $name<'a>(pub(crate) Row<'a>);
29        impl<'a> AsRow<'a> for $name<'a> {
30            const TABLE: usize = $table;
31            fn to_row(&self) -> Row<'a> {
32                self.0
33            }
34            fn from_row(row: Row<'a>) -> Self {
35                $name(row)
36            }
37        }
38    )*
39    };
40}
41
42tables! {
43    (Assembly, 0)
44    (AssemblyRef, 1)
45    (Attribute, 2)
46    (ClassLayout, 3)
47    (Constant, 4)
48    (Field, 5)
49    (GenericParam, 6)
50    (ImplMap, 7)
51    (InterfaceImpl, 8)
52    (MemberRef, 9)
53    (MethodDef, 10)
54    (MethodParam, 11)
55    (Module, 12)
56    (ModuleRef, 13)
57    (NestedClass, 14)
58    (TypeDef, 15)
59    (TypeRef, 16)
60    (TypeSpec, 17)
61}