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
26unsafe impl NSObjectProtocol for VZNetworkDevice {}
27
28impl VZNetworkDevice {
29 extern_methods!(
30 #[unsafe(method(new))]
31 #[unsafe(method_family = new)]
32 pub unsafe fn new() -> Retained<Self>;
33
34 #[unsafe(method(init))]
35 #[unsafe(method_family = init)]
36 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
37
38 #[cfg(feature = "VZNetworkDeviceAttachment")]
39 /// The network attachment that's currently connected to this network device.
40 ///
41 /// Setting this property will result in an attempt to change the network device attachment which may fail, in which case
42 /// the -[VZVirtualMachineDelegate virtualMachine:networkDevice:attachmentWasDisconnectedWithError:] will be invoked and this property
43 /// will be set to nil.
44 ///
45 /// This property may change at any time while the VM is running based on the state of the host network.
46 #[unsafe(method(attachment))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn attachment(&self) -> Option<Retained<VZNetworkDeviceAttachment>>;
49
50 #[cfg(feature = "VZNetworkDeviceAttachment")]
51 /// Setter for [`attachment`][Self::attachment].
52 #[unsafe(method(setAttachment:))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn setAttachment(&self, attachment: Option<&VZNetworkDeviceAttachment>);
55 );
56}