windows_metadata/reader/tables/
mod.rs1use 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
21macro_rules! tables {
22 ($(($name:ident, $table:literal))+) => {
23 $(
24 #[derive(Copy, Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
25 pub struct $name<'a>(pub(crate) Row<'a>);
26 impl<'a> AsRow<'a> for $name<'a> {
27 const TABLE: usize = $table;
28 fn to_row(&self) -> Row<'a> {
29 self.0
30 }
31 fn from_row(row: Row<'a>) -> Self {
32 $name(row)
33 }
34 }
35 )*
36 };
37}
38
39tables! {
40 (Attribute, 1)
41 (ClassLayout, 16)
42 (Constant, 0)
43 (Field, 2)
44 (GenericParam, 3)
45 (ImplMap, 11)
46 (InterfaceImpl, 4)
47 (MemberRef, 5)
48 (MethodDef, 6)
49 (ModuleRef, 12)
50 (NestedClass, 13)
51 (MethodParam, 7)
52 (TypeDef, 8)
53 (TypeRef, 9)
54 (TypeSpec, 10)
55 (Module, 0)
56 (AssemblyRef, 0x23)
57}