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