objc2-virtualization 0.3.2

Bindings to the Virtualization framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzerrordomain?language=objc)
    pub static VZErrorDomain: Option<&'static NSErrorDomain>;
}

/// Error type returned by the Virtualization framework.
/// The NSError domain is VZErrorDomain, the code is one of the VZErrorCode constants.
///
/// The virtualization framework can also report errors from other domains when the error originates from a lower level component.
///
///
/// Internal error such as the virtual machine unexpectedly stopping.
///
/// Invalid machine configuration.
///
/// API used with a machine in the wrong state (e.g. interacting with a machine before it is running).
///
/// Invalid change of state (e.g. pausing a virtual machine that is not started).
///
/// Unrecognized disk image format or invalid disk image.
///
/// The running virtual machine limit was exceeded.
///
/// Network error occurred.
///
/// Machine ran out of disk space.
///
/// The operation was cancelled.
///
/// The operation is not supported.
///
/// The save operation failed.
///
/// The restore operation failed.
///
/// The restore image catalog failed to load.
///
/// The restore image catalog is invalid.
///
/// The restore image catalog has no supported restore images.
///
/// The restore image failed to load.
///
/// The restore image is invalid.
///
/// A software update is required to complete the installation.
///
/// An error occurred during installation.
///
/// The connection or the negotiation with the NBD server failed.
///
/// The NBD client is disconnected from the server.
///
/// Controller not found.
///
/// Device is already attached.
///
/// Device initialization failure.
///
/// Device not found.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzerrorcode?language=objc)
// NS_ERROR_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct VZErrorCode(pub NSInteger);
impl VZErrorCode {
    #[doc(alias = "VZErrorInternal")]
    pub const Internal: Self = Self(1);
    #[doc(alias = "VZErrorInvalidVirtualMachineConfiguration")]
    pub const InvalidVirtualMachineConfiguration: Self = Self(2);
    #[doc(alias = "VZErrorInvalidVirtualMachineState")]
    pub const InvalidVirtualMachineState: Self = Self(3);
    #[doc(alias = "VZErrorInvalidVirtualMachineStateTransition")]
    pub const InvalidVirtualMachineStateTransition: Self = Self(4);
    #[doc(alias = "VZErrorInvalidDiskImage")]
    pub const InvalidDiskImage: Self = Self(5);
    #[doc(alias = "VZErrorVirtualMachineLimitExceeded")]
    pub const VirtualMachineLimitExceeded: Self = Self(6);
    #[doc(alias = "VZErrorNetworkError")]
    pub const NetworkError: Self = Self(7);
    #[doc(alias = "VZErrorOutOfDiskSpace")]
    pub const OutOfDiskSpace: Self = Self(8);
    #[doc(alias = "VZErrorOperationCancelled")]
    pub const OperationCancelled: Self = Self(9);
    #[doc(alias = "VZErrorNotSupported")]
    pub const NotSupported: Self = Self(10);
    #[doc(alias = "VZErrorSave")]
    pub const Save: Self = Self(11);
    #[doc(alias = "VZErrorRestore")]
    pub const Restore: Self = Self(12);
    #[doc(alias = "VZErrorRestoreImageCatalogLoadFailed")]
    pub const RestoreImageCatalogLoadFailed: Self = Self(10001);
    #[doc(alias = "VZErrorInvalidRestoreImageCatalog")]
    pub const InvalidRestoreImageCatalog: Self = Self(10002);
    #[doc(alias = "VZErrorNoSupportedRestoreImagesInCatalog")]
    pub const NoSupportedRestoreImagesInCatalog: Self = Self(10003);
    #[doc(alias = "VZErrorRestoreImageLoadFailed")]
    pub const RestoreImageLoadFailed: Self = Self(10004);
    #[doc(alias = "VZErrorInvalidRestoreImage")]
    pub const InvalidRestoreImage: Self = Self(10005);
    #[doc(alias = "VZErrorInstallationRequiresUpdate")]
    pub const InstallationRequiresUpdate: Self = Self(10006);
    #[doc(alias = "VZErrorInstallationFailed")]
    pub const InstallationFailed: Self = Self(10007);
    #[doc(alias = "VZErrorNetworkBlockDeviceNegotiationFailed")]
    pub const NetworkBlockDeviceNegotiationFailed: Self = Self(20001);
    #[doc(alias = "VZErrorNetworkBlockDeviceDisconnected")]
    pub const NetworkBlockDeviceDisconnected: Self = Self(20002);
    #[doc(alias = "VZErrorUSBControllerNotFound")]
    pub const USBControllerNotFound: Self = Self(30001);
    #[doc(alias = "VZErrorDeviceAlreadyAttached")]
    pub const DeviceAlreadyAttached: Self = Self(30002);
    #[doc(alias = "VZErrorDeviceInitializationFailure")]
    pub const DeviceInitializationFailure: Self = Self(30003);
    #[doc(alias = "VZErrorDeviceNotFound")]
    pub const DeviceNotFound: Self = Self(30004);
}

unsafe impl Encode for VZErrorCode {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for VZErrorCode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}