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

Fields§

§rid: u32

Row identifier within the AssemblyRefOS metadata table

The 1-based index of this AssemblyRefOS row within the table.

§token: Token

Metadata 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: usize

Byte 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: u32

Operating 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: u32

Major 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: u32

Minor version number of the target operating system

The minor version component of the required OS version (e.g., 1 for Windows 7).

§assembly_ref: AssemblyRefRc

Reference 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

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.