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