1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
//! Implementation of `RowReadable` for `ModuleRefRaw` metadata table entries.
//!
//! This module provides binary deserialization support for the `ModuleRef` table (ID 0x1A),
//! enabling reading of module reference information from .NET PE files. The ModuleRef table
//! contains references to external modules that are imported by the current assembly, providing
//! the metadata necessary for module resolution and cross-module type access.
//!
//! ## Table Structure (ECMA-335 §II.22.31)
//!
//! | Field | Type | Description |
//! |-------|------|-------------|
//! | `Name` | String heap index | Name of the referenced module |
//!
//! ## Usage Context
//!
//! ModuleRef entries are used for:
//! - **External Module References**: Identifying modules imported by the current assembly
//! - **Multi-Module Assemblies**: Supporting assemblies composed of multiple modules
//! - **Type Resolution**: Resolving types defined in external modules
//! - **Module Loading**: Providing information needed for dynamic module loading
//! - **Cross-Module Access**: Enabling access to types and members in other modules
//!
//! ## Module Reference Architecture
//!
//! .NET supports multi-module assemblies where types can be distributed across modules:
//! - **Module Names**: Each module has a unique name within the assembly
//! - **File References**: ModuleRef entries reference physical module files
//! - **Type Distribution**: Types can be defined in different modules of the same assembly
//! - **Runtime Loading**: Modules are loaded on-demand during execution
//!
//! ## Integration with Assembly Structure
//!
//! ModuleRef entries integrate with the broader assembly metadata:
//! - **File Table**: Links to actual module files on disk
//! - **ExportedType Table**: Types exported from referenced modules
//! - **ManifestResource Table**: Resources contained in referenced modules
//! - **Assembly Metadata**: Module references are scoped to the containing assembly
//!
//! ## Thread Safety
//!
//! The `RowReadable` implementation is stateless and safe for concurrent use across
//! multiple threads during metadata loading operations.
//!
//! ## Related Modules
//!
//! - [`crate::metadata::tables::moduleref::writer`] - Binary serialization support
//! - [`crate::metadata::tables::moduleref`] - High-level ModuleRef interface
//! - [`crate::metadata::tables::moduleref::raw`] - Raw structure definition
//! - [`crate::metadata::tables::file`] - File table entries for module file references
use crate::;