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")]
26extern_conformance!(
27 unsafe impl NSCopying for VZGenericPlatformConfiguration {}
28);
29
30#[cfg(feature = "VZPlatformConfiguration")]
31unsafe impl CopyingHelper for VZGenericPlatformConfiguration {
32 type Result = Self;
33}
34
35#[cfg(feature = "VZPlatformConfiguration")]
36extern_conformance!(
37 unsafe impl NSObjectProtocol for VZGenericPlatformConfiguration {}
38);
39
40#[cfg(feature = "VZPlatformConfiguration")]
41impl VZGenericPlatformConfiguration {
42 extern_methods!(
43 #[unsafe(method(init))]
44 #[unsafe(method_family = init)]
45 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
46
47 #[cfg(feature = "VZGenericMachineIdentifier")]
48 /// The unique machine identifier.
49 ///
50 /// Running two virtual machines concurrently with the same identifier results in undefined behavior
51 /// in the guest operating system. When restoring a virtual machine from saved state, this
52 /// `machineIdentifier` must match the `machineIdentifier` of the saved virtual machine.
53 #[unsafe(method(machineIdentifier))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn machineIdentifier(&self) -> Retained<VZGenericMachineIdentifier>;
56
57 #[cfg(feature = "VZGenericMachineIdentifier")]
58 /// Setter for [`machineIdentifier`][Self::machineIdentifier].
59 #[unsafe(method(setMachineIdentifier:))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn setMachineIdentifier(&self, machine_identifier: &VZGenericMachineIdentifier);
62
63 /// Indicate whether or not nested virtualization is available.
64 ///
65 /// Nested virtualization is only available on some hardware and software configurations. It may also be disabled by policy.
66 ///
67 /// Use this property to check if support is available for the platform. If nested virtualization is supported,
68 /// use `nestedVirtualizationEnabled` to enable the feature.
69 ///
70 /// See: nestedVirtualizationEnabled.
71 #[unsafe(method(isNestedVirtualizationSupported))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn isNestedVirtualizationSupported() -> bool;
74
75 /// Enable nested virtualization for the platform.
76 ///
77 /// If nested virtualization is available, enable it for the current platform configuration.
78 ///
79 /// You can use `nestedVirtualizationSupported` to discover the nested virtualization availability before enabling it.
80 ///
81 /// The default value is NO, nested virtualization is disabled.
82 ///
83 /// See: nestedVirtualizationSupported.
84 #[unsafe(method(isNestedVirtualizationEnabled))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn isNestedVirtualizationEnabled(&self) -> bool;
87
88 /// Setter for [`isNestedVirtualizationEnabled`][Self::isNestedVirtualizationEnabled].
89 #[unsafe(method(setNestedVirtualizationEnabled:))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn setNestedVirtualizationEnabled(&self, nested_virtualization_enabled: bool);
92 );
93}
94
95/// Methods declared on superclass `VZPlatformConfiguration`.
96#[cfg(feature = "VZPlatformConfiguration")]
97impl VZGenericPlatformConfiguration {
98 extern_methods!(
99 #[unsafe(method(new))]
100 #[unsafe(method_family = new)]
101 pub unsafe fn new() -> Retained<Self>;
102 );
103}