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!(
    /// VZMACAddress represents a media access control address (MAC address), the 48-bit ethernet address.
    ///
    /// The easiest way to obtain a MAC address is with +[VZMACAddress randomLocallyAdministeredAddress]. The method
    /// returns a valid local MAC address typically used with network interfaces.
    ///
    /// See: VZNetworkDeviceConfiguration
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmacaddress?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct VZMACAddress;
);

extern_conformance!(
    unsafe impl NSCopying for VZMACAddress {}
);

unsafe impl CopyingHelper for VZMACAddress {
    type Result = Self;
}

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

impl VZMACAddress {
    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>;

        /// Initialize the VZMACAddress from a string representation of a MAC address.
        ///
        /// Parameter `string`: The string should be formatted representing the 6 bytes in hexadecimal separated by a colon character.
        /// e.g. "01:23:45:ab:cd:ef"
        ///
        /// The alphabetical characters can appear lowercase or uppercase.
        ///
        /// Returns: A VZMACAddress or nil if the string is not formatted correctly.
        #[unsafe(method(initWithString:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithString(
            this: Allocated<Self>,
            string: &NSString,
        ) -> Option<Retained<Self>>;

        /// Create a valid, random, unicast, locally administered address.
        ///
        /// The generated address is not guaranteed to be unique.
        #[unsafe(method(randomLocallyAdministeredAddress))]
        #[unsafe(method_family = none)]
        pub unsafe fn randomLocallyAdministeredAddress() -> Retained<Self>;

        /// The address represented as a string.
        ///
        /// The 6 bytes are represented in hexadecimal form, separated by a colon character.
        /// Alphabetical characters are lowercase.
        ///
        /// The address is compatible with the parameter of -[VZMACAddress initWithString:].
        #[unsafe(method(string))]
        #[unsafe(method_family = none)]
        pub unsafe fn string(&self) -> Retained<NSString>;

        /// True if the address is the broadcast address, false otherwise.
        #[unsafe(method(isBroadcastAddress))]
        #[unsafe(method_family = none)]
        pub unsafe fn isBroadcastAddress(&self) -> bool;

        /// True if the address is a multicast address, false otherwise.
        #[unsafe(method(isMulticastAddress))]
        #[unsafe(method_family = none)]
        pub unsafe fn isMulticastAddress(&self) -> bool;

        /// True if the address is a unicast address, false otherwise.
        #[unsafe(method(isUnicastAddress))]
        #[unsafe(method_family = none)]
        pub unsafe fn isUnicastAddress(&self) -> bool;

        /// True if the address is a locally administered addresses (LAA), false otherwise.
        #[unsafe(method(isLocallyAdministeredAddress))]
        #[unsafe(method_family = none)]
        pub unsafe fn isLocallyAdministeredAddress(&self) -> bool;

        /// True if the address is a universally administered addresses (UAA), false otherwise.
        #[unsafe(method(isUniversallyAdministeredAddress))]
        #[unsafe(method_family = none)]
        pub unsafe fn isUniversallyAdministeredAddress(&self) -> bool;
    );
}