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
40unsafe impl NSCopying for VZMacHardwareModel {}
41
42unsafe impl CopyingHelper for VZMacHardwareModel {
43    type Result = Self;
44}
45
46unsafe impl NSObjectProtocol for VZMacHardwareModel {}
47
48impl VZMacHardwareModel {
49    extern_methods!(
50        #[unsafe(method(new))]
51        #[unsafe(method_family = new)]
52        pub unsafe fn new() -> Retained<Self>;
53
54        #[unsafe(method(init))]
55        #[unsafe(method_family = init)]
56        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
57
58        /// Get the hardware model described by the specified data representation.
59        ///
60        /// Parameter `dataRepresentation`: The opaque data representation of the hardware model to be obtained.
61        #[unsafe(method(initWithDataRepresentation:))]
62        #[unsafe(method_family = init)]
63        pub unsafe fn initWithDataRepresentation(
64            this: Allocated<Self>,
65            data_representation: &NSData,
66        ) -> Option<Retained<Self>>;
67
68        /// Opaque data representation of the hardware model.
69        ///
70        /// This can be used to recreate the same hardware model with -[VZMacHardwareModel initWithDataRepresentation:].
71        #[unsafe(method(dataRepresentation))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn dataRepresentation(&self) -> Retained<NSData>;
74
75        /// Indicate whether this hardware model is supported by the host.
76        ///
77        /// If this hardware model is not supported by the host, no VZVirtualMachineConfiguration using it will validate.
78        /// The validation error of the VZVirtualMachineConfiguration provides more information about why the hardware model is unsupported.
79        #[unsafe(method(isSupported))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn isSupported(&self) -> bool;
82    );
83}