objc2-virtualization 0.3.2

Bindings to the Virtualization framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// Define a network interface that bridges a physical interface with a virtual machine.
    ///
    /// 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
    /// but have distinct network layers.
    ///
    /// VZBridgedNetworkInterface cannot be instantiated directly. A list of supported network interfaces can be obtained using +[VZBridgedNetworkInterface networkInterfaces].
    ///
    /// The VZBridgedNetworkInterface can be used with a VZBridgedNetworkDeviceAttachment to set up a network device VZNetworkDeviceConfiguration.
    ///
    ///
    /// See also: VZBridgedNetworkDeviceAttachment
    ///
    /// See also: VZNATNetworkDeviceAttachment
    ///
    /// See also: VZNetworkDeviceConfiguration
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzbridgednetworkinterface?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct VZBridgedNetworkInterface;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for VZBridgedNetworkInterface {}
);

impl VZBridgedNetworkInterface {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        /// Return the list of network interfaces available for bridging.
        #[unsafe(method(networkInterfaces))]
        #[unsafe(method_family = none)]
        pub unsafe fn networkInterfaces() -> Retained<NSArray<VZBridgedNetworkInterface>>;

        /// Return the unique identifier for this interface. The identifier is the BSD name associated with the interface (e.g. "en0").
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Retained<NSString>;

        /// Return a display name if available (e.g. "Ethernet").
        #[unsafe(method(localizedDisplayName))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedDisplayName(&self) -> Option<Retained<NSString>>;
    );
}