objc2_virtualization/generated/VZMACAddress.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 /// VZMACAddress represents a media access control address (MAC address), the 48-bit ethernet address.
11 ///
12 /// The easiest way to obtain a MAC address is with +[VZMACAddress randomLocallyAdministeredAddress]. The method
13 /// returns a valid local MAC address typically used with network interfaces.
14 ///
15 /// See: VZNetworkDeviceConfiguration
16 ///
17 /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmacaddress?language=objc)
18 #[unsafe(super(NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 pub struct VZMACAddress;
21);
22
23unsafe impl NSCopying for VZMACAddress {}
24
25unsafe impl CopyingHelper for VZMACAddress {
26 type Result = Self;
27}
28
29unsafe impl NSObjectProtocol for VZMACAddress {}
30
31impl VZMACAddress {
32 extern_methods!(
33 #[unsafe(method(new))]
34 #[unsafe(method_family = new)]
35 pub unsafe fn new() -> Retained<Self>;
36
37 #[unsafe(method(init))]
38 #[unsafe(method_family = init)]
39 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
40
41 /// Initialize the VZMACAddress from a string representation of a MAC address.
42 ///
43 /// Parameter `string`: The string should be formatted representing the 6 bytes in hexadecimal separated by a colon character.
44 /// e.g. "01:23:45:ab:cd:ef"
45 ///
46 /// The alphabetical characters can appear lowercase or uppercase.
47 ///
48 /// Returns: A VZMACAddress or nil if the string is not formatted correctly.
49 #[unsafe(method(initWithString:))]
50 #[unsafe(method_family = init)]
51 pub unsafe fn initWithString(
52 this: Allocated<Self>,
53 string: &NSString,
54 ) -> Option<Retained<Self>>;
55
56 /// Create a valid, random, unicast, locally administered address.
57 ///
58 /// The generated address is not guaranteed to be unique.
59 #[unsafe(method(randomLocallyAdministeredAddress))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn randomLocallyAdministeredAddress() -> Retained<Self>;
62
63 /// The address represented as a string.
64 ///
65 /// The 6 bytes are represented in hexadecimal form, separated by a colon character.
66 /// Alphabetical characters are lowercase.
67 ///
68 /// The address is compatible with the parameter of -[VZMACAddress initWithString:].
69 #[unsafe(method(string))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn string(&self) -> Retained<NSString>;
72
73 /// True if the address is the broadcast address, false otherwise.
74 #[unsafe(method(isBroadcastAddress))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn isBroadcastAddress(&self) -> bool;
77
78 /// True if the address is a multicast address, false otherwise.
79 #[unsafe(method(isMulticastAddress))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn isMulticastAddress(&self) -> bool;
82
83 /// True if the address is a unicast address, false otherwise.
84 #[unsafe(method(isUnicastAddress))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn isUnicastAddress(&self) -> bool;
87
88 /// True if the address is a locally administered addresses (LAA), false otherwise.
89 #[unsafe(method(isLocallyAdministeredAddress))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn isLocallyAdministeredAddress(&self) -> bool;
92
93 /// True if the address is a universally administered addresses (UAA), false otherwise.
94 #[unsafe(method(isUniversallyAdministeredAddress))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn isUniversallyAdministeredAddress(&self) -> bool;
97 );
98}