Struct AssemblyRef
pub struct AssemblyRef {Show 17 fields
pub rid: u32,
pub token: Token,
pub offset: usize,
pub name: String,
pub culture: Option<String>,
pub major_version: u32,
pub minor_version: u32,
pub build_number: u32,
pub revision_number: u32,
pub flags: AssemblyFlags,
pub identifier: Option<Identity>,
pub hash: Option<AssemblyRefHash>,
pub os_platform_id: AtomicU32,
pub os_major_version: AtomicU32,
pub os_minor_version: AtomicU32,
pub processor: AtomicU32,
pub custom_attributes: CustomAttributeValueList,
}Expand description
Represents a .NET assembly reference with fully resolved metadata and owned data
This structure contains the complete assembly reference information from the AssemblyRef
metadata table (0x23), with all heap references resolved to owned strings and byte arrays.
Unlike crate::metadata::tables::assemblyref::raw::AssemblyRefRaw, this provides
immediate access to string data without requiring heap lookups.
§Assembly Reference Identity
An assembly reference’s identity consists of:
- Simple name: The assembly name (e.g., “mscorlib”, “System.Core”)
- Version: Four-part version number (Major.Minor.Build.Revision)
- Culture: Localization culture (None for culture-neutral assemblies)
- Public key or token: Strong name verification data (optional)
- Hash: Optional hash value for assembly integrity verification
§Additional Metadata
This structure also includes data from related tables:
AssemblyRefOS: Operating system compatibility informationAssemblyRefProcessor: Processor architecture requirements- Custom attributes: Additional metadata applied to the reference
§Thread Safety
This type is Send and Sync. Atomic fields (OS and processor data) can be
safely accessed and modified from multiple threads. Other fields are read-only
after construction and safe for concurrent access.
§References
- ECMA-335 II.22.5 -
AssemblyReftable specification - ECMA-335 II.22.7 -
AssemblyRefOStable specification - ECMA-335 II.22.8 -
AssemblyRefProcessortable specification
Fields§
§rid: u32Row identifier within the AssemblyRef table
Unique identifier for this row within the metadata table. Used for internal referencing and debugging purposes.
token: TokenMetadata token for this assembly reference
Contains the table ID (0x23) and row ID packed into a single value. Used for cross-referencing from other metadata tables.
offset: usizeFile offset where this table entry begins
Byte offset from the start of the PE file to the beginning of this
AssemblyRef table entry. Used for low-level file analysis.
name: StringSimple name of the referenced assembly
The assembly name without file extension (e.g., “mscorlib”, “System.Core”). This is the primary identifier used during assembly resolution.
culture: Option<String>Culture string for localized assemblies
Specifies the culture for satellite assemblies containing localized resources.
None indicates a culture-neutral assembly (the common case for most assemblies).
major_version: u32Major version number (first component of version)
The first part of the four-part version number. Typically incremented for major releases with breaking changes.
minor_version: u32Minor version number (second component of version)
The second part of the four-part version number. Typically incremented for minor releases with new features but no breaking changes.
build_number: u32Build number (third component of version)
The third part of the four-part version number. Often incremented for each build or compilation.
revision_number: u32Revision number (fourth component of version)
The fourth part of the four-part version number. Often used for patches or hotfixes.
flags: AssemblyFlagsAssembly flags bit field
Bitmask specifying assembly attributes using crate::metadata::tables::AssemblyFlags
constants. Controls behavior like public key format and retargetability.
identifier: Option<Identity>Strong name identity information
Contains either the full public key or public key token used for strong name
verification. None indicates the assembly is not strongly named.
hash: Option<AssemblyRefHash>Assembly integrity hash
Optional cryptographic hash of the referenced assembly for integrity verification. The hash algorithm is typically SHA-1 or MD5, though Microsoft may have extended this.
os_platform_id: AtomicU32Operating system platform identifier
Specifies the target operating system platform. Uses atomic access for thread safety.
Corresponds to entries in the AssemblyRefOS table when present.
os_major_version: AtomicU32Operating system major version
Major version number of the target operating system. Uses atomic access for thread safety.
Corresponds to entries in the AssemblyRefOS table when present.
os_minor_version: AtomicU32Operating system minor version
Minor version number of the target operating system. Uses atomic access for thread safety.
Corresponds to entries in the AssemblyRefOS table when present.
processor: AtomicU32Target processor architecture
Specifies the required processor architecture for the referenced assembly.
Uses atomic access for thread safety. Corresponds to entries in the AssemblyRefProcessor table.
custom_attributes: CustomAttributeValueListCustom attributes applied to this assembly reference
Collection of custom attributes that provide additional metadata for this assembly reference. Thread-safe collection supporting concurrent access.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AssemblyRef
impl RefUnwindSafe for AssemblyRef
impl Send for AssemblyRef
impl Sync for AssemblyRef
impl Unpin for AssemblyRef
impl UnsafeUnpin for AssemblyRef
impl UnwindSafe for AssemblyRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for T
impl<T> Downcast for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.