objc2_virtualization/generated/
VZBridgedNetworkDeviceAttachment.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8extern_class!(
9    /// Network device attachment bridging a host physical interface with a virtual network device.
10    ///
11    /// A bridged network allows the virtual machine to use the same physical interface as the host. Both host and virtual machine
12    /// send and receive packets on the same physical interface but have distinct network layers.
13    ///
14    /// The bridge network device attachment is used with a VZNetworkDeviceConfiguration to define a virtual network device.
15    ///
16    /// Using a VZBridgedNetworkDeviceAttachment requires the app to have the "com.apple.vm.networking" entitlement.
17    ///
18    ///
19    /// See: VZBridgedNetworkInterface
20    ///
21    /// See: VZNetworkDeviceConfiguration
22    ///
23    /// See: VZVirtioNetworkDeviceConfiguration
24    ///
25    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzbridgednetworkdeviceattachment?language=objc)
26    #[unsafe(super(VZNetworkDeviceAttachment, NSObject))]
27    #[derive(Debug, PartialEq, Eq, Hash)]
28    #[cfg(feature = "VZNetworkDeviceAttachment")]
29    pub struct VZBridgedNetworkDeviceAttachment;
30);
31
32#[cfg(feature = "VZNetworkDeviceAttachment")]
33extern_conformance!(
34    unsafe impl NSObjectProtocol for VZBridgedNetworkDeviceAttachment {}
35);
36
37#[cfg(feature = "VZNetworkDeviceAttachment")]
38impl VZBridgedNetworkDeviceAttachment {
39    extern_methods!(
40        #[cfg(feature = "VZBridgedNetworkInterface")]
41        /// Initialize a VZBridgedNetworkDeviceAttachment with a host network interface.
42        ///
43        /// Parameter `interface`: Host network interface controller.
44        #[unsafe(method(initWithInterface:))]
45        #[unsafe(method_family = init)]
46        pub unsafe fn initWithInterface(
47            this: Allocated<Self>,
48            interface: &VZBridgedNetworkInterface,
49        ) -> Retained<Self>;
50
51        #[cfg(feature = "VZBridgedNetworkInterface")]
52        /// Network interface of this device attachment.
53        #[unsafe(method(interface))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn interface(&self) -> Retained<VZBridgedNetworkInterface>;
56    );
57}
58
59/// Methods declared on superclass `VZNetworkDeviceAttachment`.
60#[cfg(feature = "VZNetworkDeviceAttachment")]
61impl VZBridgedNetworkDeviceAttachment {
62    extern_methods!(
63        #[unsafe(method(new))]
64        #[unsafe(method_family = new)]
65        pub unsafe fn new() -> Retained<Self>;
66
67        #[unsafe(method(init))]
68        #[unsafe(method_family = init)]
69        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
70    );
71}