objc2_virtualization/generated/VZGenericPlatformConfiguration.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 a generic Intel or ARM virtual machine.
12 ///
13 /// When a virtual machine is saved to disk then loaded again, the `machineIdentifier`
14 /// must be restored to the original value.
15 ///
16 /// If multiple virtual machines are created from the same configuration, each should have a unique `machineIdentifier`.
17 ///
18 /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzgenericplatformconfiguration?language=objc)
19 #[unsafe(super(VZPlatformConfiguration, NSObject))]
20 #[derive(Debug, PartialEq, Eq, Hash)]
21 #[cfg(feature = "VZPlatformConfiguration")]
22 pub struct VZGenericPlatformConfiguration;
23);
24
25#[cfg(feature = "VZPlatformConfiguration")]
26unsafe impl NSCopying for VZGenericPlatformConfiguration {}
27
28#[cfg(feature = "VZPlatformConfiguration")]
29unsafe impl CopyingHelper for VZGenericPlatformConfiguration {
30 type Result = Self;
31}
32
33#[cfg(feature = "VZPlatformConfiguration")]
34unsafe impl NSObjectProtocol for VZGenericPlatformConfiguration {}
35
36#[cfg(feature = "VZPlatformConfiguration")]
37impl VZGenericPlatformConfiguration {
38 extern_methods!(
39 #[unsafe(method(init))]
40 #[unsafe(method_family = init)]
41 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
42
43 #[cfg(feature = "VZGenericMachineIdentifier")]
44 /// The unique machine identifier.
45 ///
46 /// Running two virtual machines concurrently with the same identifier results in undefined behavior
47 /// in the guest operating system. When restoring a virtual machine from saved state, this
48 /// `machineIdentifier` must match the `machineIdentifier` of the saved virtual machine.
49 #[unsafe(method(machineIdentifier))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn machineIdentifier(&self) -> Retained<VZGenericMachineIdentifier>;
52
53 #[cfg(feature = "VZGenericMachineIdentifier")]
54 /// Setter for [`machineIdentifier`][Self::machineIdentifier].
55 #[unsafe(method(setMachineIdentifier:))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn setMachineIdentifier(&self, machine_identifier: &VZGenericMachineIdentifier);
58
59 /// Indicate whether or not nested virtualization is available.
60 ///
61 /// Nested virtualization is only available on some hardware and software configurations. It may also be disabled by policy.
62 ///
63 /// Use this property to check if support is available for the platform. If nested virtualization is supported,
64 /// use `nestedVirtualizationEnabled` to enable the feature.
65 ///
66 /// See: nestedVirtualizationEnabled.
67 #[unsafe(method(isNestedVirtualizationSupported))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn isNestedVirtualizationSupported() -> bool;
70
71 /// Enable nested virtualization for the platform.
72 ///
73 /// If nested virtualization is available, enable it for the current platform configuration.
74 ///
75 /// You can use `nestedVirtualizationSupported` to discover the nested virtualization availability before enabling it.
76 ///
77 /// The default value is NO, nested virtualization is disabled.
78 ///
79 /// See: nestedVirtualizationSupported.
80 #[unsafe(method(isNestedVirtualizationEnabled))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn isNestedVirtualizationEnabled(&self) -> bool;
83
84 /// Setter for [`isNestedVirtualizationEnabled`][Self::isNestedVirtualizationEnabled].
85 #[unsafe(method(setNestedVirtualizationEnabled:))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn setNestedVirtualizationEnabled(&self, nested_virtualization_enabled: bool);
88 );
89}
90
91/// Methods declared on superclass `VZPlatformConfiguration`.
92#[cfg(feature = "VZPlatformConfiguration")]
93impl VZGenericPlatformConfiguration {
94 extern_methods!(
95 #[unsafe(method(new))]
96 #[unsafe(method_family = new)]
97 pub unsafe fn new() -> Retained<Self>;
98 );
99}