Struct AssemblyOSBuilder
pub struct AssemblyOSBuilder { /* private fields */ }Expand description
Builder for constructing AssemblyOS table entries
Provides a fluent interface for building AssemblyOS metadata table entries.
These entries specify operating system targeting information for assemblies,
though they are rarely used in modern .NET applications which rely on runtime
platform abstraction.
§Required Fields
os_platform_id: Operating system platform identifieros_major_version: Major version number of the target OSos_minor_version: Minor version number of the target OS
§Historical Context
The AssemblyOS table was designed for early .NET Framework scenarios where assemblies might need explicit OS compatibility declarations. Modern applications typically rely on runtime platform abstraction instead of metadata-level OS targeting.
§Examples
use dotscope::prelude::*;
// Windows 10 targeting
let win10_os = AssemblyOSBuilder::new()
.os_platform_id(1) // Windows platform
.os_major_version(10) // Windows 10
.os_minor_version(0) // Windows 10.0
.build(&mut context)?;
// Windows 7 targeting
let win7_os = AssemblyOSBuilder::new()
.os_platform_id(1) // Windows platform
.os_major_version(6) // Windows 7
.os_minor_version(1) // Windows 7.1
.build(&mut context)?;
// Custom OS targeting
let custom_os = AssemblyOSBuilder::new()
.os_platform_id(99) // Custom platform
.os_major_version(1) // Major version
.os_minor_version(0) // Minor version
.build(&mut context)?;Implementations§
§impl AssemblyOSBuilder
impl AssemblyOSBuilder
pub fn new() -> Self
pub fn new() -> Self
Creates a new AssemblyOSBuilder with default values
Initializes a new builder instance with all fields unset. The caller must provide all required fields before calling build().
§Returns
A new AssemblyOSBuilder instance ready for configuration
§Examples
use dotscope::prelude::*;
let builder = AssemblyOSBuilder::new();pub fn os_platform_id(self, os_platform_id: u32) -> Self
pub fn os_platform_id(self, os_platform_id: u32) -> Self
Sets the operating system platform identifier
Specifies the target operating system platform. While ECMA-335 doesn’t standardize exact values, common historical identifiers include Windows, Unix, and other platform designations.
§Parameters
os_platform_id: The operating system platform identifier
§Returns
Self for method chaining
§Common Values
1: Windows platforms2: Unix/Linux platforms3: macOS platforms- Custom values for proprietary platforms
§Examples
use dotscope::prelude::*;
// Windows platform
let builder = AssemblyOSBuilder::new()
.os_platform_id(1);
// Unix/Linux platform
let builder = AssemblyOSBuilder::new()
.os_platform_id(2);pub fn os_major_version(self, os_major_version: u32) -> Self
pub fn os_major_version(self, os_major_version: u32) -> Self
Sets the major version number of the target OS
Specifies the major version of the target operating system. Combined with minor version to specify exact OS version requirements.
§Parameters
os_major_version: The major version number
§Returns
Self for method chaining
§Examples
use dotscope::prelude::*;
// Windows 10 (major version 10)
let builder = AssemblyOSBuilder::new()
.os_major_version(10);
// Windows 7 (major version 6)
let builder = AssemblyOSBuilder::new()
.os_major_version(6);pub fn os_minor_version(self, os_minor_version: u32) -> Self
pub fn os_minor_version(self, os_minor_version: u32) -> Self
Sets the minor version number of the target OS
Specifies the minor version of the target operating system. Combined with major version to specify exact OS version requirements.
§Parameters
os_minor_version: The minor version number
§Returns
Self for method chaining
§Examples
use dotscope::prelude::*;
// Windows 10.0 (minor version 0)
let builder = AssemblyOSBuilder::new()
.os_minor_version(0);
// Windows 7.1 (minor version 1)
let builder = AssemblyOSBuilder::new()
.os_minor_version(1);pub fn build(self, context: &mut BuilderContext) -> Result<Token>
pub fn build(self, context: &mut BuilderContext) -> Result<Token>
Builds and adds the AssemblyOS entry to the metadata
Validates all required fields, creates the AssemblyOS table entry,
and adds it to the builder context. Returns a token that can be used
to reference this assembly OS entry.
§Parameters
context: Mutable reference to the builder context
§Returns
Ok(Token): Token referencing the created assembly OS entryErr(Error): If validation fails or table operations fail
§Errors
- Missing required field (os_platform_id, os_major_version, or os_minor_version)
- Table operations fail due to metadata constraints
§Examples
use dotscope::prelude::*;
let mut context = BuilderContext::new();
let token = AssemblyOSBuilder::new()
.os_platform_id(1)
.os_major_version(10)
.os_minor_version(0)
.build(&mut context)?;Trait Implementations§
§impl Clone for AssemblyOSBuilder
impl Clone for AssemblyOSBuilder
§fn clone(&self) -> AssemblyOSBuilder
fn clone(&self) -> AssemblyOSBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for AssemblyOSBuilder
impl Debug for AssemblyOSBuilder
§impl Default for AssemblyOSBuilder
impl Default for AssemblyOSBuilder
§fn default() -> Self
fn default() -> Self
Creates a default AssemblyOSBuilder
Equivalent to calling AssemblyOSBuilder::new().
Auto Trait Implementations§
impl Freeze for AssemblyOSBuilder
impl RefUnwindSafe for AssemblyOSBuilder
impl Send for AssemblyOSBuilder
impl Sync for AssemblyOSBuilder
impl Unpin for AssemblyOSBuilder
impl UnwindSafe for AssemblyOSBuilder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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