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 core::ptr::NonNull;
use objc2::__framework_prelude::*;

use crate::*;

extern_class!(
    /// Class representing a hot-pluggable USB Mass Storage device.
    ///
    /// This device is created through either instantiating it directly and passing VZUSBMassStorageDeviceConfiguration to its initializer
    /// or instantiating a VZUSBMassStorageDeviceConfiguration in a VZVirtualMachineConfiguration. Direct instantiation will create
    /// an object that can be passed to -[VZUSBController attachDevice:completionHandler:] method. Instantiation via VZUSBMassStorageDeviceConfiguration
    /// will make the device available in VZUSBController.usbDevices property.
    ///
    /// See: VZUSBController
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzusbmassstoragedevice?language=objc)
    #[unsafe(super(VZStorageDevice, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "VZStorageDevice")]
    pub struct VZUSBMassStorageDevice;
);

#[cfg(feature = "VZStorageDevice")]
extern_conformance!(
    unsafe impl NSObjectProtocol for VZUSBMassStorageDevice {}
);

#[cfg(all(feature = "VZStorageDevice", feature = "VZUSBDevice"))]
extern_conformance!(
    unsafe impl VZUSBDevice for VZUSBMassStorageDevice {}
);

#[cfg(feature = "VZStorageDevice")]
impl VZUSBMassStorageDevice {
    extern_methods!(
        #[cfg(all(
            feature = "VZStorageDeviceConfiguration",
            feature = "VZUSBMassStorageDeviceConfiguration"
        ))]
        /// Initialize the runtime USB Mass Storage device object.
        ///
        /// Parameter `configuration`: The configuration of the USB Mass Storage device.
        ///
        /// See: VZUSBMassStorageDeviceConfiguration
        #[unsafe(method(initWithConfiguration:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithConfiguration(
            this: Allocated<Self>,
            configuration: &VZUSBMassStorageDeviceConfiguration,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `VZStorageDevice`.
#[cfg(feature = "VZStorageDevice")]
impl VZUSBMassStorageDevice {
    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>;
    );
}