objc2_virtualization/generated/
VZError.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4use objc2_foundation::*;
5
6use crate::*;
7
8extern "C" {
9    /// [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzerrordomain?language=objc)
10    pub static VZErrorDomain: Option<&'static NSErrorDomain>;
11}
12
13/// Error type returned by the Virtualization framework.
14/// The NSError domain is VZErrorDomain, the code is one of the VZErrorCode constants.
15///
16/// The virtualization framework can also report errors from other domains when the error originates from a lower level component.
17///
18///
19/// Internal error such as the virtual machine unexpectedly stopping.
20///
21/// Invalid machine configuration.
22///
23/// API used with a machine in the wrong state (e.g. interacting with a machine before it is running).
24///
25/// Invalid change of state (e.g. pausing a virtual machine that is not started).
26///
27/// Unrecognized disk image format or invalid disk image.
28///
29/// The running virtual machine limit was exceeded.
30///
31/// Network error occurred.
32///
33/// Machine ran out of disk space.
34///
35/// The operation was cancelled.
36///
37/// The operation is not supported.
38///
39/// The save operation failed.
40///
41/// The restore operation failed.
42///
43/// The restore image catalog failed to load.
44///
45/// The restore image catalog is invalid.
46///
47/// The restore image catalog has no supported restore images.
48///
49/// The restore image failed to load.
50///
51/// The restore image is invalid.
52///
53/// A software update is required to complete the installation.
54///
55/// An error occurred during installation.
56///
57/// The connection or the negotiation with the NBD server failed.
58///
59/// The NBD client is disconnected from the server.
60///
61/// Controller not found.
62///
63/// Device is already attached.
64///
65/// Device initialization failure.
66///
67/// Device not found.
68///
69/// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzerrorcode?language=objc)
70// NS_ERROR_ENUM
71#[repr(transparent)]
72#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
73pub struct VZErrorCode(pub NSInteger);
74impl VZErrorCode {
75    #[doc(alias = "VZErrorInternal")]
76    pub const Internal: Self = Self(1);
77    #[doc(alias = "VZErrorInvalidVirtualMachineConfiguration")]
78    pub const InvalidVirtualMachineConfiguration: Self = Self(2);
79    #[doc(alias = "VZErrorInvalidVirtualMachineState")]
80    pub const InvalidVirtualMachineState: Self = Self(3);
81    #[doc(alias = "VZErrorInvalidVirtualMachineStateTransition")]
82    pub const InvalidVirtualMachineStateTransition: Self = Self(4);
83    #[doc(alias = "VZErrorInvalidDiskImage")]
84    pub const InvalidDiskImage: Self = Self(5);
85    #[doc(alias = "VZErrorVirtualMachineLimitExceeded")]
86    pub const VirtualMachineLimitExceeded: Self = Self(6);
87    #[doc(alias = "VZErrorNetworkError")]
88    pub const NetworkError: Self = Self(7);
89    #[doc(alias = "VZErrorOutOfDiskSpace")]
90    pub const OutOfDiskSpace: Self = Self(8);
91    #[doc(alias = "VZErrorOperationCancelled")]
92    pub const OperationCancelled: Self = Self(9);
93    #[doc(alias = "VZErrorNotSupported")]
94    pub const NotSupported: Self = Self(10);
95    #[doc(alias = "VZErrorSave")]
96    pub const Save: Self = Self(11);
97    #[doc(alias = "VZErrorRestore")]
98    pub const Restore: Self = Self(12);
99    #[doc(alias = "VZErrorRestoreImageCatalogLoadFailed")]
100    pub const RestoreImageCatalogLoadFailed: Self = Self(10001);
101    #[doc(alias = "VZErrorInvalidRestoreImageCatalog")]
102    pub const InvalidRestoreImageCatalog: Self = Self(10002);
103    #[doc(alias = "VZErrorNoSupportedRestoreImagesInCatalog")]
104    pub const NoSupportedRestoreImagesInCatalog: Self = Self(10003);
105    #[doc(alias = "VZErrorRestoreImageLoadFailed")]
106    pub const RestoreImageLoadFailed: Self = Self(10004);
107    #[doc(alias = "VZErrorInvalidRestoreImage")]
108    pub const InvalidRestoreImage: Self = Self(10005);
109    #[doc(alias = "VZErrorInstallationRequiresUpdate")]
110    pub const InstallationRequiresUpdate: Self = Self(10006);
111    #[doc(alias = "VZErrorInstallationFailed")]
112    pub const InstallationFailed: Self = Self(10007);
113    #[doc(alias = "VZErrorNetworkBlockDeviceNegotiationFailed")]
114    pub const NetworkBlockDeviceNegotiationFailed: Self = Self(20001);
115    #[doc(alias = "VZErrorNetworkBlockDeviceDisconnected")]
116    pub const NetworkBlockDeviceDisconnected: Self = Self(20002);
117    #[doc(alias = "VZErrorUSBControllerNotFound")]
118    pub const USBControllerNotFound: Self = Self(30001);
119    #[doc(alias = "VZErrorDeviceAlreadyAttached")]
120    pub const DeviceAlreadyAttached: Self = Self(30002);
121    #[doc(alias = "VZErrorDeviceInitializationFailure")]
122    pub const DeviceInitializationFailure: Self = Self(30003);
123    #[doc(alias = "VZErrorDeviceNotFound")]
124    pub const DeviceNotFound: Self = Self(30004);
125}
126
127unsafe impl Encode for VZErrorCode {
128    const ENCODING: Encoding = NSInteger::ENCODING;
129}
130
131unsafe impl RefEncode for VZErrorCode {
132    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
133}