objc2_virtualization/generated/
VZBridgedNetworkInterface.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::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// Define a network interface that bridges a physical interface with a virtual machine.
11    ///
12    /// A bridged interface is shared between the virtual machine and the host system. Both host and virtual machine send and receive packets on the same physical interface
13    /// but have distinct network layers.
14    ///
15    /// VZBridgedNetworkInterface cannot be instantiated directly. A list of supported network interfaces can be obtained using +[VZBridgedNetworkInterface networkInterfaces].
16    ///
17    /// The VZBridgedNetworkInterface can be used with a VZBridgedNetworkDeviceAttachment to set up a network device VZNetworkDeviceConfiguration.
18    ///
19    ///
20    /// See also: VZBridgedNetworkDeviceAttachment
21    ///
22    /// See also: VZNATNetworkDeviceAttachment
23    ///
24    /// See also: VZNetworkDeviceConfiguration
25    ///
26    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzbridgednetworkinterface?language=objc)
27    #[unsafe(super(NSObject))]
28    #[derive(Debug, PartialEq, Eq, Hash)]
29    pub struct VZBridgedNetworkInterface;
30);
31
32unsafe impl NSObjectProtocol for VZBridgedNetworkInterface {}
33
34impl VZBridgedNetworkInterface {
35    extern_methods!(
36        #[unsafe(method(new))]
37        #[unsafe(method_family = new)]
38        pub unsafe fn new() -> Retained<Self>;
39
40        #[unsafe(method(init))]
41        #[unsafe(method_family = init)]
42        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
43
44        /// Return the list of network interfaces available for bridging.
45        #[unsafe(method(networkInterfaces))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn networkInterfaces() -> Retained<NSArray<VZBridgedNetworkInterface>>;
48
49        /// Return the unique identifier for this interface. The identifier is the BSD name associated with the interface (e.g. "en0").
50        #[unsafe(method(identifier))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn identifier(&self) -> Retained<NSString>;
53
54        /// Return a display name if available (e.g. "Ethernet").
55        #[unsafe(method(localizedDisplayName))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn localizedDisplayName(&self) -> Option<Retained<NSString>>;
58    );
59}