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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// Describes a specific virtual Mac hardware model.
///
/// The Mac hardware model abstracts a set of virtualized hardware elements and configurations.
/// A version of macOS may only run on certain hardware models. The host may also only provide certain hardware models
/// based on the version of macOS and the underlying hardware.
/// Use VZMacHardwareModel.supported to know if a hardware model is supported on the current host.
///
/// Choosing the hardware model starts from a restore image with VZMacOSRestoreImage.
/// A restore image describes its supported configuration requirements through VZMacOSRestoreImage.mostFeaturefulSupportedConfiguration.
/// A configuration requirements object has a corresponding hardware model that can be used to configure a virtual machine
/// that meets the requirements.
///
/// Once the hardware model is obtained, use VZMacPlatformConfiguration.hardwareModel to configure the Mac platform,
/// and -[VZMacAuxiliaryStorage initCreatingStorageAtURL:hardwareModel:options:error:] to create its auxiliary storage.
/// Once the virtual machine is created, use VZMacOSInstaller to install macOS on it.
///
/// If the virtual machine is preserved on disk, the hardware model used for installation should be preserved for subsequent boots.
/// The VZMacHardwareModel.dataRepresentation property provides a unique binary representation that can be serialized.
/// The hardware model then can be recreated from the binary representation with -[VZMacHardwareModel initWithDataRepresentation:].
///
/// See also: VZMacOSInstaller
///
/// See also: VZMacOSRestoreImage
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmachardwaremodel?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct VZMacHardwareModel;
);
extern_conformance!(
unsafe impl NSCopying for VZMacHardwareModel {}
);
unsafe impl CopyingHelper for VZMacHardwareModel {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for VZMacHardwareModel {}
);
impl VZMacHardwareModel {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// Get the hardware model described by the specified data representation.
///
/// Parameter `dataRepresentation`: The opaque data representation of the hardware model to be obtained.
#[unsafe(method(initWithDataRepresentation:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDataRepresentation(
this: Allocated<Self>,
data_representation: &NSData,
) -> Option<Retained<Self>>;
/// Opaque data representation of the hardware model.
///
/// This can be used to recreate the same hardware model with -[VZMacHardwareModel initWithDataRepresentation:].
#[unsafe(method(dataRepresentation))]
#[unsafe(method_family = none)]
pub unsafe fn dataRepresentation(&self) -> Retained<NSData>;
/// Indicate whether this hardware model is supported by the host.
///
/// If this hardware model is not supported by the host, no VZVirtualMachineConfiguration using it will validate.
/// The validation error of the VZVirtualMachineConfiguration provides more information about why the hardware model is unsupported.
#[unsafe(method(isSupported))]
#[unsafe(method_family = none)]
pub unsafe fn isSupported(&self) -> bool;
);
}