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")]
38unsafe impl NSCopying for VZMacPlatformConfiguration {}
39
40#[cfg(feature = "VZPlatformConfiguration")]
41unsafe impl CopyingHelper for VZMacPlatformConfiguration {
42    type Result = Self;
43}
44
45#[cfg(feature = "VZPlatformConfiguration")]
46unsafe impl NSObjectProtocol for VZMacPlatformConfiguration {}
47
48#[cfg(feature = "VZPlatformConfiguration")]
49impl VZMacPlatformConfiguration {
50    extern_methods!(
51        #[unsafe(method(init))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
54
55        #[cfg(feature = "VZMacHardwareModel")]
56        /// The Mac hardware model.
57        #[unsafe(method(hardwareModel))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn hardwareModel(&self) -> Retained<VZMacHardwareModel>;
60
61        #[cfg(feature = "VZMacHardwareModel")]
62        /// Setter for [`hardwareModel`][Self::hardwareModel].
63        #[unsafe(method(setHardwareModel:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn setHardwareModel(&self, hardware_model: &VZMacHardwareModel);
66
67        #[cfg(feature = "VZMacMachineIdentifier")]
68        /// The unique Mac machine identifier.
69        ///
70        /// Running two virtual machines concurrently with the same identifier results in undefined behavior in the guest operating system.
71        #[unsafe(method(machineIdentifier))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn machineIdentifier(&self) -> Retained<VZMacMachineIdentifier>;
74
75        #[cfg(feature = "VZMacMachineIdentifier")]
76        /// Setter for [`machineIdentifier`][Self::machineIdentifier].
77        #[unsafe(method(setMachineIdentifier:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn setMachineIdentifier(&self, machine_identifier: &VZMacMachineIdentifier);
80
81        #[cfg(feature = "VZMacAuxiliaryStorage")]
82        /// The Mac auxiliary storage.
83        ///
84        /// When creating a virtual machine from scratch, the hardware model of the `auxiliaryStorage` must match the hardware model of
85        /// the `hardwareModel` property.
86        #[unsafe(method(auxiliaryStorage))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn auxiliaryStorage(&self) -> Option<Retained<VZMacAuxiliaryStorage>>;
89
90        #[cfg(feature = "VZMacAuxiliaryStorage")]
91        /// Setter for [`auxiliaryStorage`][Self::auxiliaryStorage].
92        #[unsafe(method(setAuxiliaryStorage:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setAuxiliaryStorage(&self, auxiliary_storage: Option<&VZMacAuxiliaryStorage>);
95    );
96}
97
98/// Methods declared on superclass `VZPlatformConfiguration`.
99#[cfg(feature = "VZPlatformConfiguration")]
100impl VZMacPlatformConfiguration {
101    extern_methods!(
102        #[unsafe(method(new))]
103        #[unsafe(method_family = new)]
104        pub unsafe fn new() -> Retained<Self>;
105    );
106}