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