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
29unsafe impl NSCopying for VZMacMachineIdentifier {}
30
31unsafe impl CopyingHelper for VZMacMachineIdentifier {
32 type Result = Self;
33}
34
35unsafe impl NSObjectProtocol for VZMacMachineIdentifier {}
36
37impl VZMacMachineIdentifier {
38 extern_methods!(
39 /// Create a new unique machine identifier.
40 #[unsafe(method(init))]
41 #[unsafe(method_family = init)]
42 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
43
44 /// Get the machine identifier described by the specified data representation.
45 ///
46 /// Parameter `dataRepresentation`: The opaque data representation of the machine identifier to be obtained.
47 ///
48 /// Returns: A unique identifier identical to the one that generated the dataRepresentation, or nil if the data is invalid.
49 ///
50 /// See: VZMacMachineIdentifier.dataRepresentation
51 #[unsafe(method(initWithDataRepresentation:))]
52 #[unsafe(method_family = init)]
53 pub unsafe fn initWithDataRepresentation(
54 this: Allocated<Self>,
55 data_representation: &NSData,
56 ) -> Option<Retained<Self>>;
57
58 /// Opaque data representation of the machine identifier.
59 ///
60 /// This can be used to recreate the same machine identifier with -[VZMacMachineIdentifier initWithDataRepresentation:].
61 ///
62 /// See: -[VZMacMachineIdentifier initWithDataRepresentation:]
63 #[unsafe(method(dataRepresentation))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn dataRepresentation(&self) -> Retained<NSData>;
66 );
67}
68
69/// Methods declared on superclass `NSObject`.
70impl VZMacMachineIdentifier {
71 extern_methods!(
72 #[unsafe(method(new))]
73 #[unsafe(method_family = new)]
74 pub unsafe fn new() -> Retained<Self>;
75 );
76}