objc2_virtualization/generated/
VZMacPlatformConfiguration.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// The platform configuration for booting macOS on Apple Silicon.
12    ///
13    /// When creating a virtual machine from scratch, the `hardwareModel` and `auxiliaryStorage` depend on the restore image
14    /// that will be used to install macOS.
15    ///
16    /// To choose the hardware model, start from VZMacOSRestoreImage.mostFeaturefulSupportedConfiguration to get a supported configuration, then
17    /// use its VZMacOSConfigurationRequirements.hardwareModel property to get the hardware model.
18    /// Use the hardware model to set up VZMacPlatformConfiguration and to initialize a new auxiliary storage with
19    /// -[VZMacAuxiliaryStorage initCreatingStorageAtURL:hardwareModel:options:error:].
20    ///
21    /// When a virtual machine is saved to disk then loaded again, the `hardwareModel`, `machineIdentifier` and `auxiliaryStorage`
22    /// must be restored to their original values.
23    ///
24    /// If multiple virtual machines are created from the same configuration, each should have a unique  `auxiliaryStorage` and `machineIdentifier`.
25    ///
26    /// See also: VZMacOSRestoreImage
27    ///
28    /// See also: VZMacOSConfigurationRequirements
29    ///
30    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmacplatformconfiguration?language=objc)
31    #[unsafe(super(VZPlatformConfiguration, NSObject))]
32    #[derive(Debug, PartialEq, Eq, Hash)]
33    #[cfg(feature = "VZPlatformConfiguration")]
34    pub struct VZMacPlatformConfiguration;
35);
36
37#[cfg(feature = "VZPlatformConfiguration")]
38extern_conformance!(
39    unsafe impl NSCopying for VZMacPlatformConfiguration {}
40);
41
42#[cfg(feature = "VZPlatformConfiguration")]
43unsafe impl CopyingHelper for VZMacPlatformConfiguration {
44    type Result = Self;
45}
46
47#[cfg(feature = "VZPlatformConfiguration")]
48extern_conformance!(
49    unsafe impl NSObjectProtocol for VZMacPlatformConfiguration {}
50);
51
52#[cfg(feature = "VZPlatformConfiguration")]
53impl VZMacPlatformConfiguration {
54    extern_methods!(
55        #[unsafe(method(init))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
58
59        #[cfg(feature = "VZMacHardwareModel")]
60        /// The Mac hardware model.
61        #[unsafe(method(hardwareModel))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn hardwareModel(&self) -> Retained<VZMacHardwareModel>;
64
65        #[cfg(feature = "VZMacHardwareModel")]
66        /// Setter for [`hardwareModel`][Self::hardwareModel].
67        ///
68        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
69        #[unsafe(method(setHardwareModel:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn setHardwareModel(&self, hardware_model: &VZMacHardwareModel);
72
73        #[cfg(feature = "VZMacMachineIdentifier")]
74        /// The unique Mac machine identifier.
75        ///
76        /// Running two virtual machines concurrently with the same identifier results in undefined behavior in the guest operating system.
77        #[unsafe(method(machineIdentifier))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn machineIdentifier(&self) -> Retained<VZMacMachineIdentifier>;
80
81        #[cfg(feature = "VZMacMachineIdentifier")]
82        /// Setter for [`machineIdentifier`][Self::machineIdentifier].
83        ///
84        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
85        #[unsafe(method(setMachineIdentifier:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn setMachineIdentifier(&self, machine_identifier: &VZMacMachineIdentifier);
88
89        #[cfg(feature = "VZMacAuxiliaryStorage")]
90        /// The Mac auxiliary storage.
91        ///
92        /// When creating a virtual machine from scratch, the hardware model of the `auxiliaryStorage` must match the hardware model of
93        /// the `hardwareModel` property.
94        #[unsafe(method(auxiliaryStorage))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn auxiliaryStorage(&self) -> Option<Retained<VZMacAuxiliaryStorage>>;
97
98        #[cfg(feature = "VZMacAuxiliaryStorage")]
99        /// Setter for [`auxiliaryStorage`][Self::auxiliaryStorage].
100        #[unsafe(method(setAuxiliaryStorage:))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn setAuxiliaryStorage(&self, auxiliary_storage: Option<&VZMacAuxiliaryStorage>);
103    );
104}
105
106/// Methods declared on superclass `VZPlatformConfiguration`.
107#[cfg(feature = "VZPlatformConfiguration")]
108impl VZMacPlatformConfiguration {
109    extern_methods!(
110        #[unsafe(method(new))]
111        #[unsafe(method_family = new)]
112        pub unsafe fn new() -> Retained<Self>;
113    );
114}