objc2_virtualization/generated/VZMacHardwareModel.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 /// Describes a specific virtual Mac hardware model.
11 ///
12 /// The Mac hardware model abstracts a set of virtualized hardware elements and configurations.
13 /// A version of macOS may only run on certain hardware models. The host may also only provide certain hardware models
14 /// based on the version of macOS and the underlying hardware.
15 /// Use VZMacHardwareModel.supported to know if a hardware model is supported on the current host.
16 ///
17 /// Choosing the hardware model starts from a restore image with VZMacOSRestoreImage.
18 /// A restore image describes its supported configuration requirements through VZMacOSRestoreImage.mostFeaturefulSupportedConfiguration.
19 /// A configuration requirements object has a corresponding hardware model that can be used to configure a virtual machine
20 /// that meets the requirements.
21 ///
22 /// Once the hardware model is obtained, use VZMacPlatformConfiguration.hardwareModel to configure the Mac platform,
23 /// and -[VZMacAuxiliaryStorage initCreatingStorageAtURL:hardwareModel:options:error:] to create its auxiliary storage.
24 /// Once the virtual machine is created, use VZMacOSInstaller to install macOS on it.
25 ///
26 /// If the virtual machine is preserved on disk, the hardware model used for installation should be preserved for subsequent boots.
27 /// The VZMacHardwareModel.dataRepresentation property provides a unique binary representation that can be serialized.
28 /// The hardware model then can be recreated from the binary representation with -[VZMacHardwareModel initWithDataRepresentation:].
29 ///
30 /// See also: VZMacOSInstaller
31 ///
32 /// See also: VZMacOSRestoreImage
33 ///
34 /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmachardwaremodel?language=objc)
35 #[unsafe(super(NSObject))]
36 #[derive(Debug, PartialEq, Eq, Hash)]
37 pub struct VZMacHardwareModel;
38);
39
40extern_conformance!(
41 unsafe impl NSCopying for VZMacHardwareModel {}
42);
43
44unsafe impl CopyingHelper for VZMacHardwareModel {
45 type Result = Self;
46}
47
48extern_conformance!(
49 unsafe impl NSObjectProtocol for VZMacHardwareModel {}
50);
51
52impl VZMacHardwareModel {
53 extern_methods!(
54 #[unsafe(method(new))]
55 #[unsafe(method_family = new)]
56 pub unsafe fn new() -> Retained<Self>;
57
58 #[unsafe(method(init))]
59 #[unsafe(method_family = init)]
60 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
61
62 /// Get the hardware model described by the specified data representation.
63 ///
64 /// Parameter `dataRepresentation`: The opaque data representation of the hardware model to be obtained.
65 #[unsafe(method(initWithDataRepresentation:))]
66 #[unsafe(method_family = init)]
67 pub unsafe fn initWithDataRepresentation(
68 this: Allocated<Self>,
69 data_representation: &NSData,
70 ) -> Option<Retained<Self>>;
71
72 /// Opaque data representation of the hardware model.
73 ///
74 /// This can be used to recreate the same hardware model with -[VZMacHardwareModel initWithDataRepresentation:].
75 #[unsafe(method(dataRepresentation))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn dataRepresentation(&self) -> Retained<NSData>;
78
79 /// Indicate whether this hardware model is supported by the host.
80 ///
81 /// If this hardware model is not supported by the host, no VZVirtualMachineConfiguration using it will validate.
82 /// The validation error of the VZVirtualMachineConfiguration provides more information about why the hardware model is unsupported.
83 #[unsafe(method(isSupported))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn isSupported(&self) -> bool;
86 );
87}