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

use crate::*;

extern_protocol!(
    /// A class conforming to the VZVirtualMachineDelegate protocol can provide methods for tracking the virtual machine state.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtualmachinedelegate?language=objc)
    pub unsafe trait VZVirtualMachineDelegate: NSObjectProtocol {
        #[cfg(feature = "VZVirtualMachine")]
        /// Invoked when a guest has stopped the virtual machine.
        ///
        /// Parameter `virtualMachine`: The virtual machine invoking the delegate method.
        #[optional]
        #[unsafe(method(guestDidStopVirtualMachine:))]
        #[unsafe(method_family = none)]
        unsafe fn guestDidStopVirtualMachine(&self, virtual_machine: &VZVirtualMachine);

        #[cfg(feature = "VZVirtualMachine")]
        /// Invoked when a virtual machine is stopped due to an error.
        ///
        /// Parameter `virtualMachine`: The virtual machine invoking the delegate method.
        ///
        /// Parameter `error`: The error.
        #[optional]
        #[unsafe(method(virtualMachine:didStopWithError:))]
        #[unsafe(method_family = none)]
        unsafe fn virtualMachine_didStopWithError(
            &self,
            virtual_machine: &VZVirtualMachine,
            error: &NSError,
        );

        #[cfg(all(feature = "VZNetworkDevice", feature = "VZVirtualMachine"))]
        /// Invoked when a virtual machine's network attachment has been disconnected.
        ///
        /// This method is invoked every time that the network interface fails to start, resulting in the network attachment being disconnected. This can happen
        /// in many situations such as initial boot, device reset, reboot, etc. Therefore, this method may be invoked several times during a virtual machine's life cycle.
        ///
        /// The VZNetworkDevice.attachment property will be nil after the method is invoked.
        ///
        /// Parameter `virtualMachine`: The virtual machine invoking the delegate method.
        ///
        /// Parameter `networkDevice`: The network device whose attachment was disconnected.
        ///
        /// Parameter `error`: The error.
        #[optional]
        #[unsafe(method(virtualMachine:networkDevice:attachmentWasDisconnectedWithError:))]
        #[unsafe(method_family = none)]
        unsafe fn virtualMachine_networkDevice_attachmentWasDisconnectedWithError(
            &self,
            virtual_machine: &VZVirtualMachine,
            network_device: &VZNetworkDevice,
            error: &NSError,
        );
    }
);