Struct AssemblyRefOs
pub struct AssemblyRefOs {
pub rid: u32,
pub token: Token,
pub offset: usize,
pub os_platform_id: u32,
pub os_major_version: u32,
pub os_minor_version: u32,
pub assembly_ref: AssemblyRefRc,
}Expand description
Represents operating system compatibility information for an external assembly reference
This structure contains OS targeting information from the AssemblyRefOS metadata table (0x25),
with all references resolved to owned data. Unlike crate::metadata::tables::assemblyrefos::raw::AssemblyRefOsRaw,
this provides immediate access to the referenced assembly without requiring table lookups.
§Operating System Targeting
The AssemblyRefOS table allows specifying explicit OS requirements for external assemblies:
- Platform ID: Operating system family identifier
- Major Version: Target OS major version number
- Minor Version: Target OS minor version number
- Assembly Reference: The external assembly these requirements apply to
§Historical Context
This table is rarely used in modern .NET assemblies and is considered legacy. It was designed for early .NET Framework scenarios where assemblies might need explicit OS compatibility declarations. Modern .NET relies on runtime platform abstraction instead.
§Thread Safety
This type is Send and Sync. All fields are read-only after construction and safe
for concurrent access. The apply method uses atomic operations when updating assembly
reference data.
§References
- ECMA-335 II.22.7 -
AssemblyRefOStable specification
Fields§
§rid: u32Row identifier within the AssemblyRefOS metadata table
The 1-based index of this AssemblyRefOS row within the table.
token: TokenMetadata token for this AssemblyRefOS entry
Combines the table identifier (0x25 for AssemblyRefOS) with the row ID to create
a unique token that can be used to reference this entry from other metadata.
offset: usizeByte offset of this AssemblyRefOS row within the metadata tables stream
Physical location of the raw AssemblyRefOS data within the metadata binary format.
Used for debugging and low-level metadata analysis.
os_platform_id: u32Operating system platform identifier
Specifies the target operating system family. Common values include:
- 1: Windows 32-bit
- 2: Windows 64-bit
- Other values for various platform types
os_major_version: u32Major version number of the target operating system
The major version component of the required OS version (e.g., 6 for Windows Vista/7/8).
os_minor_version: u32Minor version number of the target operating system
The minor version component of the required OS version (e.g., 1 for Windows 7).
assembly_ref: AssemblyRefRcReference to the external assembly that these OS requirements apply to
Points to the corresponding crate::metadata::tables::assemblyref::AssemblyRef
entry that represents the external assembly dependency.
Implementations§
§impl AssemblyRefOs
impl AssemblyRefOs
pub fn apply(&self) -> Result<()>
pub fn apply(&self) -> Result<()>
Apply operating system compatibility information to the referenced assembly
Updates the referenced assembly with OS platform and version information from this
AssemblyRefOS entry. The assembly reference already contains atomic fields for storing
OS data, allowing thread-safe updates without additional synchronization.
§Returns
Ok(())- OS information successfully applied to assembly reference
§Errors
This function never returns an error as atomic operations cannot fail.
§Thread Safety
This method is thread-safe as it uses atomic operations to update the assembly reference. Multiple threads can safely call this method concurrently.
Auto Trait Implementations§
impl Freeze for AssemblyRefOs
impl RefUnwindSafe for AssemblyRefOs
impl Send for AssemblyRefOs
impl Sync for AssemblyRefOs
impl Unpin for AssemblyRefOs
impl UnwindSafe for AssemblyRefOs
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
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 more