objc2_virtualization/generated/
VZNetworkDevice.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::*;
6
7use crate::*;
8
9extern_class!(
10    /// Class representing a network device in a virtual machine.
11    ///
12    /// VZNetworkDevice should not be instantiated directly.
13    ///
14    /// Network devices are first configured on the VZVirtualMachineConfiguration through a subclass of VZNetworkDeviceConfiguration.
15    /// When a VZVirtualMachine is created from the configuration, the network devices are available through the VZVirtualMachine.networkDevices property.
16    ///
17    ///
18    /// See: VZNetworkDeviceConfiguration
19    ///
20    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vznetworkdevice?language=objc)
21    #[unsafe(super(NSObject))]
22    #[derive(Debug, PartialEq, Eq, Hash)]
23    pub struct VZNetworkDevice;
24);
25
26extern_conformance!(
27    unsafe impl NSObjectProtocol for VZNetworkDevice {}
28);
29
30impl VZNetworkDevice {
31    extern_methods!(
32        #[unsafe(method(new))]
33        #[unsafe(method_family = new)]
34        pub unsafe fn new() -> Retained<Self>;
35
36        #[unsafe(method(init))]
37        #[unsafe(method_family = init)]
38        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
39
40        #[cfg(feature = "VZNetworkDeviceAttachment")]
41        /// The network attachment that's currently connected to this network device.
42        ///
43        /// Setting this property will result in an attempt to change the network device attachment which may fail, in which case
44        /// the -[VZVirtualMachineDelegate virtualMachine:networkDevice:attachmentWasDisconnectedWithError:] will be invoked and this property
45        /// will be set to nil.
46        ///
47        /// This property may change at any time while the VM is running based on the state of the host network.
48        #[unsafe(method(attachment))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn attachment(&self) -> Option<Retained<VZNetworkDeviceAttachment>>;
51
52        #[cfg(feature = "VZNetworkDeviceAttachment")]
53        /// Setter for [`attachment`][Self::attachment].
54        #[unsafe(method(setAttachment:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn setAttachment(&self, attachment: Option<&VZNetworkDeviceAttachment>);
57    );
58}