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        #[unsafe(method(setHardwareModel:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn setHardwareModel(&self, hardware_model: &VZMacHardwareModel);
70
71        #[cfg(feature = "VZMacMachineIdentifier")]
72        /// The unique Mac machine identifier.
73        ///
74        /// Running two virtual machines concurrently with the same identifier results in undefined behavior in the guest operating system.
75        #[unsafe(method(machineIdentifier))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn machineIdentifier(&self) -> Retained<VZMacMachineIdentifier>;
78
79        #[cfg(feature = "VZMacMachineIdentifier")]
80        /// Setter for [`machineIdentifier`][Self::machineIdentifier].
81        #[unsafe(method(setMachineIdentifier:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn setMachineIdentifier(&self, machine_identifier: &VZMacMachineIdentifier);
84
85        #[cfg(feature = "VZMacAuxiliaryStorage")]
86        /// The Mac auxiliary storage.
87        ///
88        /// When creating a virtual machine from scratch, the hardware model of the `auxiliaryStorage` must match the hardware model of
89        /// the `hardwareModel` property.
90        #[unsafe(method(auxiliaryStorage))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn auxiliaryStorage(&self) -> Option<Retained<VZMacAuxiliaryStorage>>;
93
94        #[cfg(feature = "VZMacAuxiliaryStorage")]
95        /// Setter for [`auxiliaryStorage`][Self::auxiliaryStorage].
96        #[unsafe(method(setAuxiliaryStorage:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn setAuxiliaryStorage(&self, auxiliary_storage: Option<&VZMacAuxiliaryStorage>);
99    );
100}
101
102/// Methods declared on superclass `VZPlatformConfiguration`.
103#[cfg(feature = "VZPlatformConfiguration")]
104impl VZMacPlatformConfiguration {
105    extern_methods!(
106        #[unsafe(method(new))]
107        #[unsafe(method_family = new)]
108        pub unsafe fn new() -> Retained<Self>;
109    );
110}