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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
//! 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::*;
/// Options when creating a new auxiliary storage.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmacauxiliarystorageinitializationoptions?language=objc)
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct VZMacAuxiliaryStorageInitializationOptions(pub NSUInteger);
bitflags::bitflags! {
impl VZMacAuxiliaryStorageInitializationOptions: NSUInteger {
/// Overwrite an existing auxiliary storage.
#[doc(alias = "VZMacAuxiliaryStorageInitializationOptionAllowOverwrite")]
const AllowOverwrite = 1<<0;
}
}
unsafe impl Encode for VZMacAuxiliaryStorageInitializationOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for VZMacAuxiliaryStorageInitializationOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
/// Mac auxiliary storage.
///
/// The Mac auxiliary storage contains data used by the boot loader and the guest operating system. It is necessary to boot a macOS guest OS.
///
/// When creating a new virtual machine from scratch, VZMacOSInstaller can use a default initialized auxiliary storage.
/// Use -[VZMacAuxiliaryStorage initCreatingStorageAtURL:hardwareModel:options:error:] to create an empty auxiliary storage.
///
/// The hardware model used when creating the new auxiliary storage depends on the restore image that will be used for installation.
/// From the restore image, use VZMacOSRestoreImage.mostFeaturefulSupportedConfiguration to get a supported configuration.
/// A configuration has a VZMacHardwareModel associated with it.
///
/// After initializing the new auxiliary storage, set it on VZMacPlatformConfiguration.auxiliaryStorage to use it.
/// The hardware model in VZMacPlatformConfiguration.hardwareModel must be identical to the one used to create the empty
/// auxiliary storage. The behavior is undefined otherwise.
///
/// When installing macOS, the VZMacOSInstaller lays out data on the auxiliary storage.
/// After installation, the macOS guest uses the auxiliary storage for every subsequent boot.
///
/// When moving or doing a backup of a virtual machine, the file containing the auxiliary storage must also be moved
/// or copied along with the main disk image.
///
/// To boot a virtual machine that has already been installed with VZMacOSInstaller, use -[VZMacAuxiliaryStorage initWithContentsOfURL:]
/// to set up the auxiliary storage from the existing file used at installation.
/// When using an existing file, the hardware model of the VZMacPlatformConfiguration must match the hardware model used when
/// the file was created.
///
/// See also: VZMacPlatformConfiguration
///
/// See also: VZMacOSRestoreImage
///
/// See also: VZMacOSConfigurationRequirements
///
/// See also: VZMacOSInstaller
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmacauxiliarystorage?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct VZMacAuxiliaryStorage;
);
extern_conformance!(
unsafe impl NSObjectProtocol for VZMacAuxiliaryStorage {}
);
impl VZMacAuxiliaryStorage {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// Initialize the auxiliary storage from the URL of an existing file.
///
/// Parameter `URL`: The URL of the auxiliary storage on the local file system.
///
/// To create a new auxiliary storage, use -[VZMacAuxiliaryStorage initCreatingStorageAtURL:hardwareModel:options:error].
#[unsafe(method(initWithURL:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
#[cfg(feature = "VZMacHardwareModel")]
/// Write an initialized VZMacAuxiliaryStorage to a URL on a file system.
///
/// Parameter `URL`: The URL to write the auxiliary storage to on the local file system.
///
/// Parameter `hardwareModel`: The hardware model to use. The auxiliary storage can be laid out differently for different hardware models.
///
/// Parameter `options`: Initialization options.
///
/// Parameter `error`: If not nil, used to report errors if creation fails.
///
/// Returns: A newly initialized VZMacAuxiliaryStorage on success. If an error was encountered returns
/// `nil,`and
/// `error`contains the error.
#[unsafe(method(initCreatingStorageAtURL:hardwareModel:options:error:_))]
#[unsafe(method_family = init)]
pub unsafe fn initCreatingStorageAtURL_hardwareModel_options_error(
this: Allocated<Self>,
url: &NSURL,
hardware_model: &VZMacHardwareModel,
options: VZMacAuxiliaryStorageInitializationOptions,
) -> Result<Retained<Self>, Retained<NSError>>;
/// The URL of the auxiliary storage on the local file system.
#[unsafe(method(URL))]
#[unsafe(method_family = none)]
pub unsafe fn URL(&self) -> Retained<NSURL>;
);
}
/// VZDeprecated.
impl VZMacAuxiliaryStorage {
extern_methods!(
#[deprecated]
#[unsafe(method(initWithContentsOfURL:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithContentsOfURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
);
}