objc2_virtualization/generated/
VZMacMachineIdentifier.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    /// An identifier to make a virtual machine unique.
11    ///
12    /// The Mac machine identifier is used by macOS guests to uniquely identify the virtual hardware.
13    ///
14    /// Two virtual machines running concurrently should not use the same identifier.
15    ///
16    /// If the virtual machine is serialized to disk, the identifier can be preserved in a binary representation through VZMacMachineIdentifier.dataRepresentation.
17    /// The identifier can then be recreated with -[VZMacMachineIdentifier initWithDataRepresentation:] from the binary representation.
18    ///
19    /// The contents of two identifiers can be compared with -[VZMacMachineIdentifier isEqual:].
20    ///
21    /// See also: VZMacPlatformConfiguration
22    ///
23    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmacmachineidentifier?language=objc)
24    #[unsafe(super(NSObject))]
25    #[derive(Debug, PartialEq, Eq, Hash)]
26    pub struct VZMacMachineIdentifier;
27);
28
29extern_conformance!(
30    unsafe impl NSCopying for VZMacMachineIdentifier {}
31);
32
33unsafe impl CopyingHelper for VZMacMachineIdentifier {
34    type Result = Self;
35}
36
37extern_conformance!(
38    unsafe impl NSObjectProtocol for VZMacMachineIdentifier {}
39);
40
41impl VZMacMachineIdentifier {
42    extern_methods!(
43        /// Create a new unique machine identifier.
44        #[unsafe(method(init))]
45        #[unsafe(method_family = init)]
46        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
47
48        /// Get the machine identifier described by the specified data representation.
49        ///
50        /// Parameter `dataRepresentation`: The opaque data representation of the machine identifier to be obtained.
51        ///
52        /// Returns: A unique identifier identical to the one that generated the dataRepresentation, or nil if the data is invalid.
53        ///
54        /// See: VZMacMachineIdentifier.dataRepresentation
55        #[unsafe(method(initWithDataRepresentation:))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn initWithDataRepresentation(
58            this: Allocated<Self>,
59            data_representation: &NSData,
60        ) -> Option<Retained<Self>>;
61
62        /// Opaque data representation of the machine identifier.
63        ///
64        /// This can be used to recreate the same machine identifier with -[VZMacMachineIdentifier initWithDataRepresentation:].
65        ///
66        /// See: -[VZMacMachineIdentifier initWithDataRepresentation:]
67        #[unsafe(method(dataRepresentation))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn dataRepresentation(&self) -> Retained<NSData>;
70    );
71}
72
73/// Methods declared on superclass `NSObject`.
74impl VZMacMachineIdentifier {
75    extern_methods!(
76        #[unsafe(method(new))]
77        #[unsafe(method_family = new)]
78        pub unsafe fn new() -> Retained<Self>;
79    );
80}