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
//! `AssemblyRef` table loader implementation.
//!
//! This module provides the loader implementation for the `AssemblyRef` metadata table,
//! which contains references to external assemblies. The
//! [`crate::metadata::tables::assemblyref::loader::AssemblyRefLoader`] handles the
//! conversion from raw `AssemblyRef` table data to fully resolved instances with
//! heap-resolved string and blob references.
//!
//! # Architecture
//!
//! The loader follows the standard metadata loading pattern, implementing the
//! [`crate::metadata::loader::MetadataLoader`] trait to process table data during
//! the dual variant resolution phase. `AssemblyRef` entries require heap resolution
//! for string and blob references.
//!
//! # Key Components
//!
//! - [`crate::metadata::tables::assemblyref::loader::AssemblyRefLoader`] - Main loader implementation
//! - [`crate::metadata::tables::assemblyref::AssemblyRefRaw`] - Raw table row structure
//! - [`crate::metadata::tables::assemblyref::AssemblyRef`] - Resolved table entry
//! - [`crate::metadata::loader::LoaderContext`] - Context for loading operations
//!
//! # `AssemblyRef` Table Loading
//!
//! The `AssemblyRef` table (0x23) contains references to external assemblies that the current
//! assembly depends on. During loading, the following data is resolved:
//! - **Assembly name**: String heap index → UTF-8 string
//! - **Culture**: String heap index → Culture identifier string
//! - **Public key token**: Blob heap index → Cryptographic token bytes
//! - **Hash value**: Blob heap index → Assembly hash bytes (optional)
//! - **Version information**: Major, minor, build, revision numbers
//! - **Assembly flags**: Platform targeting and processing flags
//!
//! # Dependencies
//!
//! The `AssemblyRef` loader has no table dependencies and can be loaded early in the
//! metadata loading pipeline. It only requires:
//! - **String heap**: For assembly names and culture identifiers
//! - **Blob heap**: For public key tokens and hash values
//! - **Tables header**: For raw `AssemblyRef` table access
//!
//! # Error Handling
//!
//! This module defines the following error categories:
//! - **Invalid heap indexes**: String or blob references outside heap bounds
//! - **Malformed metadata**: Corrupted `AssemblyRef` table structure
//! - **Memory allocation**: Insufficient memory during resolution
//! - **Concurrent access**: Parallel processing synchronization issues
//!
//! # Integration
//!
//! This module integrates with:
//! - [`crate::metadata::loader`] - Core metadata loading infrastructure
//! - [`crate::metadata::tables`] - Table structure definitions
//! - [`crate::metadata::streams`] - String and blob heap access
//!
//! # References
//!
//! - [ECMA-335 II.22.5](https://ecma-international.org/wp-content/uploads/ECMA-335_6th_edition_june_2012.pdf) - `AssemblyRef` table specification
use crate::;
/// Metadata loader for the `AssemblyRef` table (0x23)
///
/// Implements [`crate::metadata::loader::MetadataLoader`] to handle loading and resolution
/// of `AssemblyRef` metadata table entries. This loader processes external assembly references,
/// resolving string and blob heap indexes to create fully populated
/// [`crate::metadata::tables::assemblyref::AssemblyRef`] instances.
///
/// # Thread Safety
///
/// This type is [`Send`] and [`Sync`] as it contains no mutable state and all operations
/// are read-only during the metadata loading phase. The loader uses parallel iteration
/// for performance when processing large `AssemblyRef` tables.
pub ;