objc2_virtualization/generated/
VZVirtualMachineDelegate.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11    /// A class conforming to the VZVirtualMachineDelegate protocol can provide methods for tracking the virtual machine state.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtualmachinedelegate?language=objc)
14    pub unsafe trait VZVirtualMachineDelegate: NSObjectProtocol {
15        #[cfg(feature = "VZVirtualMachine")]
16        /// Invoked when a guest has stopped the virtual machine.
17        ///
18        /// Parameter `virtualMachine`: The virtual machine invoking the delegate method.
19        #[optional]
20        #[unsafe(method(guestDidStopVirtualMachine:))]
21        #[unsafe(method_family = none)]
22        unsafe fn guestDidStopVirtualMachine(&self, virtual_machine: &VZVirtualMachine);
23
24        #[cfg(feature = "VZVirtualMachine")]
25        /// Invoked when a virtual machine is stopped due to an error.
26        ///
27        /// Parameter `virtualMachine`: The virtual machine invoking the delegate method.
28        ///
29        /// Parameter `error`: The error.
30        #[optional]
31        #[unsafe(method(virtualMachine:didStopWithError:))]
32        #[unsafe(method_family = none)]
33        unsafe fn virtualMachine_didStopWithError(
34            &self,
35            virtual_machine: &VZVirtualMachine,
36            error: &NSError,
37        );
38
39        #[cfg(all(feature = "VZNetworkDevice", feature = "VZVirtualMachine"))]
40        /// Invoked when a virtual machine's network attachment has been disconnected.
41        ///
42        /// This method is invoked every time that the network interface fails to start, resulting in the network attachment being disconnected. This can happen
43        /// 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.
44        ///
45        /// The VZNetworkDevice.attachment property will be nil after the method is invoked.
46        ///
47        /// Parameter `virtualMachine`: The virtual machine invoking the delegate method.
48        ///
49        /// Parameter `networkDevice`: The network device whose attachment was disconnected.
50        ///
51        /// Parameter `error`: The error.
52        #[optional]
53        #[unsafe(method(virtualMachine:networkDevice:attachmentWasDisconnectedWithError:))]
54        #[unsafe(method_family = none)]
55        unsafe fn virtualMachine_networkDevice_attachmentWasDisconnectedWithError(
56            &self,
57            virtual_machine: &VZVirtualMachine,
58            network_device: &VZNetworkDevice,
59            error: &NSError,
60        );
61    }
62);