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
32extern_conformance!(
33 unsafe impl NSObjectProtocol for VZBridgedNetworkInterface {}
34);
35
36impl VZBridgedNetworkInterface {
37 extern_methods!(
38 #[unsafe(method(new))]
39 #[unsafe(method_family = new)]
40 pub unsafe fn new() -> Retained<Self>;
41
42 #[unsafe(method(init))]
43 #[unsafe(method_family = init)]
44 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
45
46 /// Return the list of network interfaces available for bridging.
47 #[unsafe(method(networkInterfaces))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn networkInterfaces() -> Retained<NSArray<VZBridgedNetworkInterface>>;
50
51 /// Return the unique identifier for this interface. The identifier is the BSD name associated with the interface (e.g. "en0").
52 #[unsafe(method(identifier))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn identifier(&self) -> Retained<NSString>;
55
56 /// Return a display name if available (e.g. "Ethernet").
57 #[unsafe(method(localizedDisplayName))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn localizedDisplayName(&self) -> Option<Retained<NSString>>;
60 );
61}